build: disable warning -Wunreachable-code-break

This warning remains silent in unity builds. Since we're using unity
in CI for most jobs, warnings remain undetected there.
Disable them for all builds to avoid a surprise warning outside our CI.

The issue caught by the warning is useful for a tidy codebase, but
doesn't affect executed code. It was enabled in
84338c4de2 #12331 (2023-11-15).

llvm source: fee2953f23/clang/lib/Sema/AnalysisBasedWarnings.cpp (L125-L134)
llvm issue: https://github.com/llvm/llvm-project/issues/71046

Follow-up to 7c023c3f6e #15384
Closes #15416
This commit is contained in:
Viktor Szakats 2024-10-25 22:31:29 +02:00
parent e77326403d
commit 0da1489eb9
No known key found for this signature in database
GPG Key ID: B5ABD165E2AEF201
2 changed files with 2 additions and 2 deletions

View File

@ -138,7 +138,7 @@ if(PICKY_COMPILER)
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 6.3))
list(APPEND _picky_enable
${_picky_common}
-Wunreachable-code-break # clang 3.5 appleclang 6.0
# -Wunreachable-code-break # clang 3.5 appleclang 6.0 # Not used: Silent in "unity" builds
-Wheader-guard # clang 3.4 appleclang 5.1
-Wsometimes-uninitialized # clang 3.2 appleclang 4.6
)

View File

@ -879,7 +879,7 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [
dnl Only clang 3.5 or later
if test "$compiler_num" -ge "305"; then
CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [pragmas])
CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [unreachable-code-break])
# CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [unreachable-code-break]) # Not used: Silent in "unity" builds
fi
#
dnl Only clang 3.6 or later