From db35f1402d9eff3659eeffe34cca5c288312755b Mon Sep 17 00:00:00 2001 From: Omair Majid Date: Fri, 15 Mar 2024 07:39:54 -0400 Subject: [PATCH] Disable new warnings introduced with clang 18 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 https://github.com/dotnet/arcade/pull/14572 to actually try and use clang-18/clang++-18. --- eng/native/configurecompiler.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eng/native/configurecompiler.cmake b/eng/native/configurecompiler.cmake index 0ab4a178b055fa..57d3aed47158a8 100644 --- a/eng/native/configurecompiler.cmake +++ b/eng/native/configurecompiler.cmake @@ -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)