From da14f4e19e72f2d7b7ea71ed420880358715a8f2 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 3 Jun 2021 12:00:47 -0400 Subject: gitlab-ci: add job to build with clang-analyzer Update the exceptions in `CTestCustom.cmake.in` to match this job's needs. Drop exceptions needed only by our previous nightly build. --- .gitlab-ci.yml | 9 +++++++ .gitlab/ci/configure_fedora34_clang_analyzer.cmake | 1 + .gitlab/ci/env_fedora34_clang_analyzer.sh | 2 ++ .gitlab/os-linux.yml | 9 +++++++ CTestCustom.cmake.in | 29 ++++++++-------------- 5 files changed, 32 insertions(+), 18 deletions(-) create mode 100644 .gitlab/ci/configure_fedora34_clang_analyzer.cmake create mode 100644 .gitlab/ci/env_fedora34_clang_analyzer.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index aac1d9c91e..bf002228c4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -129,6 +129,15 @@ lint:fedora34-sphinx: CMAKE_CI_JOB_CONTINUOUS: "true" CMAKE_CI_JOB_HELP: "true" +lint:fedora34-clang-analyzer: + extends: + - .fedora34_clang_analyzer + - .cmake_build_linux + - .linux_builder_tags_qt + - .run_automatically + variables: + CMAKE_CI_JOB_NIGHTLY: "true" + # Linux builds build:centos6-x86_64: diff --git a/.gitlab/ci/configure_fedora34_clang_analyzer.cmake b/.gitlab/ci/configure_fedora34_clang_analyzer.cmake new file mode 100644 index 0000000000..e00f8a7b1b --- /dev/null +++ b/.gitlab/ci/configure_fedora34_clang_analyzer.cmake @@ -0,0 +1 @@ +include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora34_common.cmake") diff --git a/.gitlab/ci/env_fedora34_clang_analyzer.sh b/.gitlab/ci/env_fedora34_clang_analyzer.sh new file mode 100644 index 0000000000..d732c0ba20 --- /dev/null +++ b/.gitlab/ci/env_fedora34_clang_analyzer.sh @@ -0,0 +1,2 @@ +export CC=/usr/libexec/ccc-analyzer +export CXX=/usr/libexec/c++-analyzer diff --git a/.gitlab/os-linux.yml b/.gitlab/os-linux.yml index e1a70ffd0a..a8c07d8c3e 100644 --- a/.gitlab/os-linux.yml +++ b/.gitlab/os-linux.yml @@ -85,6 +85,15 @@ CTEST_NO_WARNINGS_ALLOWED: 1 CMake_SKIP_INSTALL: 1 +.fedora34_clang_analyzer: + extends: .fedora34 + + variables: + CMAKE_CONFIGURATION: fedora34_clang_analyzer + CMAKE_BUILD_TYPE: Debug + CTEST_NO_WARNINGS_ALLOWED: 1 + CMake_SKIP_INSTALL: 1 + .fedora34_sphinx: extends: .fedora34 diff --git a/CTestCustom.cmake.in b/CTestCustom.cmake.in index 682297e14c..093c1d889e 100644 --- a/CTestCustom.cmake.in +++ b/CTestCustom.cmake.in @@ -84,27 +84,20 @@ list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION "[0-9]+ Warning\\(s\\) detected" # SunPro # clang-analyzer exceptions - "char_traits.h:.*: warning: Null pointer argument in call to string length function" - "stl_construct.h:.*: warning: Forming reference to null pointer" - ".*stl_uninitialized.h:75:19: warning: Forming reference to null pointer.*" - ".*stl_vector.h:.*: warning: Returning null reference.*" - "warning: Value stored to 'yymsg' is never read" - "warning: Value stored to 'yytoken' is never read" - "index_encoder.c.241.2. warning: Value stored to .out_start. is never read" - "index.c.*warning: Access to field.*results in a dereference of a null pointer.*loaded from variable.*" - "cmCommandArgumentLexer.cxx:[0-9]+:[0-9]+: warning: Call to 'realloc' has an allocation size of 0 bytes" - "cmDependsJavaLexer.cxx:[0-9]+:[0-9]+: warning: Call to 'realloc' has an allocation size of 0 bytes" - "cmExprLexer.cxx:[0-9]+:[0-9]+: warning: Call to 'realloc' has an allocation size of 0 bytes" - "cmListFileLexer.c:[0-9]+:[0-9]+: warning: Call to 'realloc' has an allocation size of 0 bytes" - "cmFortranLexer.cxx:[0-9]+:[0-9]+: warning: Call to 'realloc' has an allocation size of 0 bytes" - "testProcess.*warning: Dereference of null pointer .loaded from variable .invalidAddress.." + "cmListFileLexer.c:[0-9]+:[0-9]+: warning: Array subscript is undefined" + "jsoncpp/src/.*:[0-9]+:[0-9]+: warning: Value stored to .* is never read" + "liblzma/common/index_encoder.c:[0-9]+:[0-9]+: warning: Value stored to '[^']+' during its initialization is never read" + "liblzma/liblzma/common/index.c:[0-9]+:[0-9]+: warning: Access to field '[^']+' results in a dereference of a null pointer" "liblzma/simple/x86.c:[0-9]+:[0-9]+: warning: The result of the '<<' expression is undefined" - "liblzma/common/index_encoder.c:[0-9]+:[0-9]+: warning: Value stored to .* during its initialization is never read" - "libuv/src/.*:[0-9]+:[0-9]+: warning: Dereference of null pointer" - "libuv/src/.*:[0-9]+:[0-9]+: warning: The left operand of '==' is a garbage value" + "librhash/librhash/.*:[0-9]+:[0-9]+: warning: The left operand of '[^']+' is a garbage value" "libuv/src/.*:[0-9]+:[0-9]+: warning: 1st function call argument is an uninitialized value" + "libuv/src/.*:[0-9]+:[0-9]+: warning: Dereference of null pointer" + "libuv/src/.*:[0-9]+:[0-9]+: warning: The left operand of '[^']+' is a garbage value" + "nghttp2/lib/.*:[0-9]+:[0-9]+: warning: Access to field '[^']+' results in a dereference of a null pointer" "nghttp2/lib/.*:[0-9]+:[0-9]+: warning: Dereference of null pointer" - "nghttp2/lib/.*:[0-9]+:[0-9]+: warning: Value stored to .* is never read" + "nghttp2/lib/.*:[0-9]+:[0-9]+: warning: Value stored to '[^']+' is never read" + "zstd/lib/.*:[0-9]+:[0-9]+: warning: Assigned value is garbage or undefined" + "zstd/lib/.*:[0-9]+:[0-9]+: warning: Dereference of null pointer" ) if(NOT "@CMAKE_GENERATOR@" MATCHES "Xcode") -- cgit v1.2.1