Skip to content

Commit

Permalink
clang-tidy.yml: updated to Clang 18 (#307)
Browse files Browse the repository at this point in the history
* clang-tidy.yml: updated to Clang 18

* .clang-tidy: disabled `performance-enum-size` clang-tidy check

* disabled `-Wswitch-default` Clang compiler warning

* .clang-tidy: disabled `readability-redundant-inline-specifier` clang-tidy check

* .clang-tidy: disabled `readability-avoid-nested-conditional-operator` clang-tidy check for now

* CI-unixish.yml: added TODO about updated libc++ hardening mode
  • Loading branch information
firewave authored Feb 27, 2024
1 parent 03dee1b commit 6547bf7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,19 @@ Checks: >
-modernize-use-override,
-modernize-use-trailing-return-type,
-modernize-use-using,
-readability-avoid-nested-conditional-operator,
-readability-braces-around-statements,
-readability-function-cognitive-complexity,
-readability-function-size,
-readability-implicit-bool-conversion,
-readability-identifier-length,
-readability-isolate-declaration,
-readability-magic-numbers,
-readability-redundant-inline-specifier,
-readability-simplify-boolean-expr,
-readability-uppercase-literal-suffix,
-performance-avoid-endl,
-performance-enum-size,
-performance-inefficient-string-concatenation,
-performance-no-automatic-move,
-performance-noexcept-move-constructor
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/CI-unixish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ jobs:
make clean
make -j$(nproc) test selfcheck CXXFLAGS="-g3 -D_GLIBCXX_DEBUG"
# TODO: change it to -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG when the compiler is at least Clang 18
- name: Run with libc++ debug mode
if: matrix.os == 'ubuntu-22.04' && matrix.compiler == 'clang++'
run: |
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/clang-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ jobs:
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 17
sudo apt-get install clang-tidy-17
sudo ./llvm.sh 18
sudo apt-get install clang-tidy-18
- name: Verify clang-tidy configuration
run: |
clang-tidy-17 --verify-config
clang-tidy-18 --verify-config
- name: Prepare CMake
run: |
cmake -S . -B cmake.output -G "Unix Makefiles" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DDISABLE_CPP03_SYNTAX_CHECK=ON
env:
CXX: clang-17
CXX: clang-18

- name: Clang-Tidy
run: |
run-clang-tidy-17 -q -j $(nproc) -p=cmake.output
run-clang-tidy-18 -q -j $(nproc) -p=cmake.output
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wno-multichar -Wno-four-char-constants)
# ignore C++11-specific warning
add_compile_options(-Wno-suggest-override -Wno-suggest-destructor-override)
# contradicts -Wcovered-switch-default
add_compile_options(-Wno-switch-default)
# TODO: fix these?
add_compile_options(-Wno-padded -Wno-sign-conversion -Wno-implicit-int-conversion -Wno-shorten-64-to-32 -Wno-shadow-field-in-constructor)

Expand Down

0 comments on commit 6547bf7

Please sign in to comment.