From 799f32b386e262f8ac1f220802d19f3b4e6a3c80 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 9 Mar 2021 13:50:55 +0100 Subject: build: Add RTEMS_CLANG_STATIC_ANALYZER option --- spec/build/bsps/sparc/leon3/abi.yml | 4 +++- spec/build/bsps/sparc/leon3/abiclang.yml | 4 +++- spec/build/bsps/sparc/leon3/abiclanganalyzer.yml | 18 ++++++++++++++++++ spec/build/bsps/sparc/leon3/grp.yml | 4 +++- spec/build/cpukit/cpuopts.yml | 2 ++ spec/build/cpukit/optclanganalyzer.yml | 19 +++++++++++++++++++ testsuites/validation/tc-mem-rtems-malloc.c | 2 +- 7 files changed, 49 insertions(+), 4 deletions(-) create mode 100644 spec/build/bsps/sparc/leon3/abiclanganalyzer.yml create mode 100644 spec/build/cpukit/optclanganalyzer.yml diff --git a/spec/build/bsps/sparc/leon3/abi.yml b/spec/build/bsps/sparc/leon3/abi.yml index f4f1628093..a4c4153e94 100644 --- a/spec/build/bsps/sparc/leon3/abi.yml +++ b/spec/build/bsps/sparc/leon3/abi.yml @@ -25,7 +25,9 @@ default: description: | ABI flags enabled-by: -- gcc + and: + - gcc + - not: RTEMS_CLANG_STATIC_ANALYZER links: [] name: ABI_FLAGS type: build diff --git a/spec/build/bsps/sparc/leon3/abiclang.yml b/spec/build/bsps/sparc/leon3/abiclang.yml index 577129762c..1235baf789 100644 --- a/spec/build/bsps/sparc/leon3/abiclang.yml +++ b/spec/build/bsps/sparc/leon3/abiclang.yml @@ -27,7 +27,9 @@ default: description: | ABI flags enabled-by: -- clang + and: + - clang + - not: RTEMS_CLANG_STATIC_ANALYZER links: [] name: ABI_FLAGS type: build diff --git a/spec/build/bsps/sparc/leon3/abiclanganalyzer.yml b/spec/build/bsps/sparc/leon3/abiclanganalyzer.yml new file mode 100644 index 0000000000..437fdaccf0 --- /dev/null +++ b/spec/build/bsps/sparc/leon3/abiclanganalyzer.yml @@ -0,0 +1,18 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +actions: +- get-string: null +- split: null +- env-append: null +build-type: option +copyrights: +- Copyright (C) 2021 embedded brains GmbH & Co. KG +default: +- enabled-by: true + value: + - -mcpu=leon3 +description: | + ABI flags +enabled-by: RTEMS_CLANG_STATIC_ANALYZER +links: [] +name: ABI_FLAGS +type: build diff --git a/spec/build/bsps/sparc/leon3/grp.yml b/spec/build/bsps/sparc/leon3/grp.yml index d708a65735..da37e907b4 100644 --- a/spec/build/bsps/sparc/leon3/grp.yml +++ b/spec/build/bsps/sparc/leon3/grp.yml @@ -22,10 +22,12 @@ links: uid: ../objmem - role: build-dependency uid: ../grp +- role: build-dependency + uid: abi - role: build-dependency uid: abiclang - role: build-dependency - uid: abi + uid: abiclanganalyzer - role: build-dependency uid: obj - role: build-dependency diff --git a/spec/build/cpukit/cpuopts.yml b/spec/build/cpukit/cpuopts.yml index 49dfc26e4b..01fc648ced 100644 --- a/spec/build/cpukit/cpuopts.yml +++ b/spec/build/cpukit/cpuopts.yml @@ -19,6 +19,8 @@ links: uid: optarchbits - role: build-dependency uid: optclang +- role: build-dependency + uid: optclanganalyzer - role: build-dependency uid: optarflags - role: build-dependency diff --git a/spec/build/cpukit/optclanganalyzer.yml b/spec/build/cpukit/optclanganalyzer.yml new file mode 100644 index 0000000000..4404a09b21 --- /dev/null +++ b/spec/build/cpukit/optclanganalyzer.yml @@ -0,0 +1,19 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +actions: +- get-boolean: null +- env-enable: null +- define-condition: null +- set-value: -D_Atomic= +- env-append: CFLAGS +build-type: option +copyrights: +- Copyright (C) 2021 embedded brains GmbH & Co. KG +default: +- enabled-by: true + value: false +description: | + Enable the Clang Static Analyzer support. +enabled-by: true +links: [] +name: RTEMS_CLANG_STATIC_ANALYZER +type: build diff --git a/testsuites/validation/tc-mem-rtems-malloc.c b/testsuites/validation/tc-mem-rtems-malloc.c index c4ba0bc170..9f611ae150 100644 --- a/testsuites/validation/tc-mem-rtems-malloc.c +++ b/testsuites/validation/tc-mem-rtems-malloc.c @@ -261,7 +261,7 @@ static void RtemsMallocReqMalloc_Post_Size_Check( case RtemsMallocReqMalloc_Post_Size_Valid: { /* * The size of the allocated memory area shall greater than or equal to - * the ``size` parameter. + * the ``size`` parameter. */ /* Assume that the next allocation is done from adjacent memory */ ptr = ctx->ptr; -- cgit v1.2.3