mirror of
https://github.com/curl/curl.git
synced 2026-04-11 12:01:42 +08:00
cmake: extend C89-specific warning suppressions to all llvm/clang
From Apple clang-only prior to this patch.
Silencing (seen after macos-15 runner accidentally switched to
llvm/clang by default):
```
/Users/runner/work/curl/curl/lib/curlx/warnless.h:64:1: error: '_Bool' is a C99 extension [-Werror,-Wc99-extensions]
64 | bool curlx_sztouz(ssize_t sznum, size_t *puznum);
| ^
/opt/homebrew/Cellar/llvm@18/18.1.8/lib/clang/18/include/stdbool.h:20:14: note: expanded from macro 'bool'
20 | #define bool _Bool
| ^
[...]
```
Ref: https://github.com/curl/curl/actions/runs/23304345180/job/67774031335?pr=21014#step:11:39
Follow-up to 09c9afdd71 #20363
Ref: https://github.com/actions/runner-images/issues/13827
Closes #21015
This commit is contained in:
parent
a9e341a469
commit
43397b0283
@ -430,11 +430,13 @@ if(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND MSVC)
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(CMAKE_C_STANDARD STREQUAL 90 AND CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
|
||||
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2)
|
||||
if(CMAKE_C_STANDARD STREQUAL 90 AND CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.0) OR
|
||||
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2))
|
||||
list(APPEND _picky "-Wno-c99-extensions") # Avoid: warning: '_Bool' is a C99 extension
|
||||
endif()
|
||||
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 8.1)
|
||||
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.9) OR
|
||||
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 8.1))
|
||||
list(APPEND _picky "-Wno-comma") # Just silly
|
||||
endif()
|
||||
endif()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user