updated CI to Clang 16 (#4641)

This commit is contained in:
Oliver Stöneberg 2023-02-15 19:46:13 +01:00 committed by GitHub
parent 33a03f2c35
commit 367847cf57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 33 additions and 21 deletions

View File

@ -1,5 +1,5 @@
---
Checks: '*,-abseil-*,-altera-*,-android-*,-boost-*,-cert-*,-cppcoreguidelines-*,-darwin-*,-fuchsia-*,-google-*,-hicpp-*,-linuxkernel-*,-llvm-*,-llvmlibc-*,-mpi-*,-objc-*,-openmp-*,-zircon-*,google-explicit-constructor,-readability-braces-around-statements,-readability-magic-numbers,-bugprone-macro-parentheses,-readability-isolate-declaration,-readability-function-size,-modernize-use-trailing-return-type,-readability-implicit-bool-conversion,-readability-uppercase-literal-suffix,-modernize-use-auto,-readability-else-after-return,-modernize-use-default-member-init,-readability-redundant-member-init,-modernize-avoid-c-arrays,-modernize-use-equals-default,-readability-container-size-empty,-readability-simplify-boolean-expr,-bugprone-branch-clone,-bugprone-narrowing-conversions,-modernize-raw-string-literal,-readability-convert-member-functions-to-static,-modernize-loop-convert,-readability-const-return-type,-modernize-return-braced-init-list,-performance-inefficient-string-concatenation,-misc-throw-by-value-catch-by-reference,-readability-avoid-const-params-in-decls,-misc-non-private-member-variables-in-classes,-clang-analyzer-*,-bugprone-signed-char-misuse,-misc-no-recursion,-readability-use-anyofallof,-performance-no-automatic-move,-readability-function-cognitive-complexity,-readability-redundant-access-specifiers,-performance-noexcept-move-constructor,-concurrency-mt-unsafe,-bugprone-easily-swappable-parameters,-readability-suspicious-call-argument,-readability-identifier-length,-readability-container-data-pointer,-bugprone-assignment-in-if-condition,-misc-const-correctness,-portability-std-allocator-const,-modernize-deprecated-ios-base-aliases,-bugprone-unchecked-optional-access,-modernize-replace-auto-ptr,-readability-identifier-naming,-portability-simd-intrinsics'
Checks: '*,-abseil-*,-altera-*,-android-*,-boost-*,-cert-*,-cppcoreguidelines-*,-darwin-*,-fuchsia-*,-google-*,-hicpp-*,-linuxkernel-*,-llvm-*,-llvmlibc-*,-mpi-*,-objc-*,-openmp-*,-zircon-*,google-explicit-constructor,-readability-braces-around-statements,-readability-magic-numbers,-bugprone-macro-parentheses,-readability-isolate-declaration,-readability-function-size,-modernize-use-trailing-return-type,-readability-implicit-bool-conversion,-readability-uppercase-literal-suffix,-modernize-use-auto,-readability-else-after-return,-modernize-use-default-member-init,-readability-redundant-member-init,-modernize-avoid-c-arrays,-modernize-use-equals-default,-readability-container-size-empty,-readability-simplify-boolean-expr,-bugprone-branch-clone,-bugprone-narrowing-conversions,-modernize-raw-string-literal,-readability-convert-member-functions-to-static,-modernize-loop-convert,-readability-const-return-type,-modernize-return-braced-init-list,-performance-inefficient-string-concatenation,-misc-throw-by-value-catch-by-reference,-readability-avoid-const-params-in-decls,-misc-non-private-member-variables-in-classes,-clang-analyzer-*,-bugprone-signed-char-misuse,-misc-no-recursion,-readability-use-anyofallof,-performance-no-automatic-move,-readability-function-cognitive-complexity,-readability-redundant-access-specifiers,-performance-noexcept-move-constructor,-concurrency-mt-unsafe,-bugprone-easily-swappable-parameters,-readability-suspicious-call-argument,-readability-identifier-length,-readability-container-data-pointer,-bugprone-assignment-in-if-condition,-misc-const-correctness,-portability-std-allocator-const,-modernize-deprecated-ios-base-aliases,-bugprone-unchecked-optional-access,-modernize-replace-auto-ptr,-readability-identifier-naming,-portability-simd-intrinsics,-misc-use-anonymous-namespace'
WarningsAsErrors: '*'
HeaderFilterRegex: '(cli|gui|lib|oss-fuzz|test|triage)\/[a-z]+\.h'
CheckOptions:

View File

@ -33,14 +33,14 @@ jobs:
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 15
sudo ./llvm.sh 16
- name: CMake
run: |
cmake -S . -B cmake.output -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHAVE_RULES=On -DBUILD_TESTS=On -DUSE_MATCHCOMPILER=Verify -DANALYZE_ADDRESS=On -DENABLE_CHECK_INTERNAL=On -DUSE_BOOST=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On
env:
CC: clang-15
CXX: clang++-15
CC: clang-16
CXX: clang++-16
- name: Build cppcheck
run: |

View File

@ -29,8 +29,8 @@ jobs:
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 15
sudo apt-get install -y clang-tidy-15
sudo ./llvm.sh 16
sudo apt-get install -y clang-tidy-16
- name: Install Qt ${{ env.QT_VERSION }}
uses: jurplel/install-qt-action@v3
@ -41,14 +41,14 @@ jobs:
- name: Verify clang-tidy configuration
run: |
clang-tidy-15 --verify-config
clang-tidy-16 --verify-config
- name: Prepare CMake
run: |
cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DCPPCHK_GLIBCXX_DEBUG=Off
env:
CC: clang-15
CXX: clang++-15
CC: clang-16
CXX: clang++-16
- name: Prepare CMake dependencies
run: |

View File

@ -33,14 +33,14 @@ jobs:
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 15
sudo ./llvm.sh 16
- name: CMake
run: |
cmake -S . -B cmake.output -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHAVE_RULES=On -DBUILD_TESTS=On -DUSE_MATCHCOMPILER=Verify -DANALYZE_THREAD=On -DUSE_THREADS=On -DENABLE_CHECK_INTERNAL=On -DUSE_BOOST=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On
env:
CC: clang-15
CXX: clang++-15
CC: clang-16
CXX: clang++-16
- name: Build cppcheck
run: |

View File

@ -33,14 +33,14 @@ jobs:
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 15
sudo ./llvm.sh 16
- name: CMake
run: |
cmake -S . -B cmake.output -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHAVE_RULES=On -DBUILD_TESTS=On -DUSE_MATCHCOMPILER=Verify -DANALYZE_UNDEFINED=On -DENABLE_CHECK_INTERNAL=On -DUSE_BOOST=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On
env:
CC: clang-15
CXX: clang++-15
CC: clang-16
CXX: clang++-16
- name: Build cppcheck
run: |

View File

@ -54,10 +54,13 @@ We are not interesting in the size/complexity of a function.
These do not (always) increase readability.
`bugprone-macro-parentheses`<br>
`readability-implicit-bool-conversion`<br>
To be documented.
`readability-implicit-bool-conversion`<br>
This does not appear not to be useful as it is reported on very common code.
`bugprone-narrowing-conversions`<br>
`performance-no-automatic-move`<br>
@ -78,11 +81,11 @@ Disabled because of false positives with Qt `slot` methods (see https://github.c
`-clang-analyzer-*`<br>
Disable because of false positives (needs to file an upstream bug report).
Disabled because of false positives (needs to file an upstream bug report).
`misc-non-private-member-variables-in-classes`<br>
We actively use this.
We intentionally use this.
`misc-no-recursion`<br>
@ -114,9 +117,17 @@ Produces a lot of false positives since it is too vague in its analysis.
`performance-inefficient-string-concatenation`<br>
Produces many warnings which very much look like false positives (needs to be reported upstream).
Produces warnings which might be considered false positives starting with C++11 - see https://github.com/llvm/llvm-project/issues/54526.
`readability-redundant-access-specifiers`<br>
Reports warning with the Qt `<access-specifier> slots:` syntax in class declarations - see https://github.com/llvm/llvm-project/issues/60055.
`modernize-avoid-c-arrays`<br>
Produces warnings when `const char[]` is being used which is quite common in our code. Does not make sense to enable before C++17 when `std::string_view` becomes available.
Also reports a false positive about templates which deduce the array length: https://github.com/llvm/llvm-project/issues/60053.
`readability-container-size-empty`<br>
`bugprone-branch-clone`<br>
`readability-const-return-type`<br>
@ -124,9 +135,9 @@ Produces many warnings which very much look like false positives (needs to be re
`misc-throw-by-value-catch-by-reference`<br>
`readability-avoid-const-params-in-decls`<br>
`bugprone-signed-char-misuse`<br>
`readability-redundant-access-specifiers`<br>
`performance-noexcept-move-constructor`<br>
`concurrency-mt-unsafe`<br>
`misc-use-anonymous-namespace`<br>
To be evaluated.

View File

@ -9,7 +9,7 @@ if (NOT CMAKE_DISABLE_PRECOMPILE_HEADERS)
message(STATUS "Cannot use non-Clang compiler with clang-tidy when precompiled headers are enabled - skipping 'run-clang-tidy' target generation")
endif()
else()
set(RUN_CLANG_TIDY_NAMES run-clang-tidy run-clang-tidy-15 run-clang-tidy-14 run-clang-tidy-13 run-clang-tidy-12 run-clang-tidy-11 run-clang-tidy-10 run-clang-tidy-9 run-clang-tidy-8)
set(RUN_CLANG_TIDY_NAMES run-clang-tidy run-clang-tidy-16 run-clang-tidy-15 run-clang-tidy-14 run-clang-tidy-13 run-clang-tidy-12 run-clang-tidy-11 run-clang-tidy-10 run-clang-tidy-9 run-clang-tidy-8)
endif()
if (RUN_CLANG_TIDY_NAMES)

View File

@ -101,6 +101,7 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options_safe(-Wno-tautological-type-limit-compare)
add_compile_options(-Wno-disabled-macro-expansion)
add_compile_options_safe(-Wno-bitwise-instead-of-logical)
add_compile_options_safe(-Wno-unsafe-buffer-usage)
# warnings we are not interested in
add_compile_options(-Wno-four-char-constants)