-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
http: gcc 14 compiler warning on mac arm64 (cmake, unity) #14168
Comments
That's a silly warning for us since a NULL there is not a problem. But also: how is it NULL there? |
I build with gcc 14 locally on my x86_64 debian and this is not a warning I see. Does it only happen on arm64? That seems weird. How about just silence the (false positive) warning for that compiler + platform combo? |
Are you building with cmake/unity=on? |
Good question regarding the CPU. There is no Intel gcc test in CI, but could replicate it locally:
cmake:
not minimal, but straight of a curl-for-win with curl + libressl only:
With riscv64 Linux and gcc 14 this warning is not happening. Instead there is this one, where the code look correct but non-trivial for a compiler to see:
|
Confirmed this is unity-specific, and thus needs cmake. |
But we don't see these in any CI do we? |
It's on the curl-for-win daily CI run. Edit: no sorry, not the daily but the other, extended workflow. |
We explicitly never use sprintf and vsprintf in code (they are banned by checksrc). I will file a PR to remove it. |
-Wformat-overflow is not a warning that we want enabled as it does not help us. It can only bring us false positives since it warng on bad uses of sprintf and vsprintf ("that might overflow the destination buffer"). Two functions we explictly ban in curlcode. The only way this flag triggers warnings in curl code is false positives for functions we have marked with the CURL_PRINTF() macro. Further: it seems -Wformat-trunaction option might in turn also enable -Wformat-overflow, so if this second option is used, we need to explcitly set -Wno-format-overflow - not just skip setting -Wformat-overflow. Reported-by: Viktor Szakats Fixes #14168
I did this
Built curl-for-win with gcc for mac (arm64), and this compiler warning happened:
https://github.com/curl/curl-for-win/actions/runs/9906570816/job/27368394282#step:3:4688
I expected the following
No warnings.
curl/libcurl version
master f94aa3d
operating system
macOS 14 arm64 GHA runner
The text was updated successfully, but these errors were encountered: