mirror of
https://github.com/curl/curl.git
synced 2026-04-14 22:51:53 +03:00
build: set -Wno-format-signedness
Explicitly disable these warnings to allow using `-Weverything`.
There are around 600 of them across the codebase.
Silencing them has some drawbacks:
- enums (`CURLcode` mostly) would have to be cast to int to avoid
different signedness depending on C compiler.
(llvm/gcc: unsigned, MSVC/clang-cl: signed by default)
- hex masks need casts to unsigned to avoid the warning.
- fixing remaining warnings is annoying without fixing the above.
- without fixing all warnings the option cannot be enabled, to keep
the codebase warning free.
Ref: #18343 (silenced all warnings, but without the enum cast)
Follow-up to 92f215fea1 #18477
Closes #19907
This commit is contained in:
parent
3fb932d492
commit
bd19433b0e
2 changed files with 12 additions and 0 deletions
|
|
@ -232,6 +232,12 @@ if(PICKY_COMPILER)
|
|||
-Wcast-function-type-strict # clang 16.0 appleclang 16.0
|
||||
)
|
||||
endif()
|
||||
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 19.1) OR
|
||||
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 17.0))
|
||||
list(APPEND _picky_enable
|
||||
-Wno-format-signedness # clang 19.1 gcc 5.1 appleclang 17.0 # In clang-cl enums are signed ints by default
|
||||
)
|
||||
endif()
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 21.1)
|
||||
list(APPEND _picky_enable
|
||||
-Warray-compare # clang 20.1 gcc 12.0 appleclang ?
|
||||
|
|
@ -282,6 +288,7 @@ if(PICKY_COMPILER)
|
|||
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 5.0)
|
||||
list(APPEND _picky_enable
|
||||
-Warray-bounds=2 # clang 3.0 gcc 5.0 (clang default: -Warray-bounds)
|
||||
-Wno-format-signedness # clang 19.1 gcc 5.1 appleclang 17.0
|
||||
)
|
||||
endif()
|
||||
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 6.0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue