Skip to content

Commit

Permalink
Disable new warnings introduced with clang 18
Browse files Browse the repository at this point in the history
clang 18 introduces `-Wswitch-default`, which requires that every switch
must have a `default` branch. We can add missing `default` in switches,
but the other option `-Wcovered-switch-default` complains if all the
cases in a switch are exhaustive and `default` doesn't do anything. So
disable one of these mutually exclusive warnings.

We will also need to merge in the changes from
dotnet/arcade#14572 to actually try and use
clang-18/clang++-18.
  • Loading branch information
omajid committed Mar 15, 2024
1 parent 516f5c4 commit db35f14
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions eng/native/configurecompiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,9 @@ if (CLR_CMAKE_HOST_UNIX)
# other clang 16.0 suppressions
add_compile_options(-Wno-single-bit-bitfield-constant-conversion)
add_compile_options(-Wno-cast-function-type-strict)

# clang 18.1 supressions
add_compile_options(-Wno-switch-default)
else()
add_compile_options(-Wno-uninitialized)
add_compile_options(-Wno-strict-aliasing)
Expand Down

0 comments on commit db35f14

Please sign in to comment.