-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmake: really enable warnings with clang #9783
Conversation
5bf89c5
to
c75fc0c
Compare
Any takers for these new Schannel
UPDATE: Silenced them. There is chance these warnings are relevant for certain platforms (ARM7?) with particular alignment requirements, though. |
Even though `PICKY_COMPILER=ON` is the default, warnings were not enabled when using llvm/clang, because `CMAKE_COMPILER_IS_CLANG` was always false (in my tests at least). This is the single use of this variable in curl, and in a different place we already use `CMAKE_C_COMPILER_ID MATCHES "Clang"`, which works as expected, so change the condition to use that instead. Also fix the warnings uncovered by the above: - lib: add casts to silence clang warnings - schannel: add casts to silence clang warnings in ALPN code Assuming the code is correct, solve the warnings with a cast. There is a chance the warning is relevant for some platforms, perhaps ARM7 (32-bit)? (This combo isn't CI tested.) Closes #xxxx
Assuming the code is correct, solve the warnings with a cast. There is a chance the warning is relevant for some platforms, perhaps ARM7 (32-bit)? (This combo isn't CI tested.)
68c78af
to
cb9e66e
Compare
The casts seems fine, though I'd be happy if someone could take a hard look at them. One possible issue the warnings may cause is for those who build with llvm/clang and But, overall this patch only matches up CMake+clang builds with CMake+gcc and autotools ones, where warnings were enabled all along. |
Small update: The |
Even though
PICKY_COMPILER=ON
is the default, warnings were not enabled when using llvm/clang, becauseCMAKE_COMPILER_IS_CLANG
was always false (in my tests at least).This is the single use of this variable in curl, and in a different place we already use
CMAKE_C_COMPILER_ID MATCHES "Clang"
, which works as expected, so change the condition to use that instead.Also fix the warnings uncovered by the above:
lib: add casts to silence clang warnings
schannel: add casts to silence clang warnings in ALPN code
Assuming the code is correct, solve the warnings with a cast.
There is a chance the warning is relevant for some platforms,
perhaps ARM7 (32-bit)?
(This combo isn't CI tested.)
Closes #xxxx
These ones remain in brotli code (in CI it can be made a non-error via
-Wno-error=vla
):