-
-
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
In curl 7.88.1, wrapping curl_easy_setopt in macro is broken when compiling with GCC <12.1 #10726
Comments
I'm not following. A bazillion people have built with 7.88.1 headers on gcc < 12.1 already. What is it in your use of it that makes the setup break? |
/cc @monnerat |
I tried your code with gcc 9.3 and I confirm. Possible caller's workarounds using the current curl code base are:
On curl's side, I don's see any possible workaround. We'll probably need to raise the conditioning gcc version again :-( This is a pity: gcc 12.1 is only 10 month old. |
Thanks for your prompt response, I'll forward to the team that there are no plans for curl to handle the GCC bug. I too quickly tried a few tricks to try to get the #pragma directives to be correctly placed and I couldn't get it working. Looks like pushing for GCC update is the best solution. All the best. |
@monnerat: are you able to get a fix that raises the bar to 12.1 to get this fixed in the next release? |
Reported-by: kchow-FTNT on github Fixes #10726
@kchow-FTNT does #10784 fix the issue for you? |
LGTM! |
Reported-by: kchow-FTNT on github Fixes curl#10726 Closes curl#10784
I did this
Our project is currently using GCC 10.3 and as far as I know, this should be supported by curl 7.88.1. However, upon trying to upgrade curl from 7.86.0 to 7.88.1 we get some compilation errors in our existing code. The issue is known and appears to be fixed in GCC 12.1;
#pragma
statements in macros can be reordered and this interferes with disabling-Wdeprecated-declarations
.This is a rough simplification of what our code looks like, and a highly simplified version of the current logic within curl 7.88:
Please try this code snippet out on godbolt.org under GCC < 12.1 The compiler output should look something like this:
And the preprocessor output should look something like this:
Compilation will fail on every macro wrapping
curl_easy_setopt
. Take a look at the preprocessor output for both to see the reason why; In GCC < 12.1 the#pragma
directives are placed in odd positions and depending on how the macro is structured we either get a deprecation warning on the unused deprecated CURLOPT, or the code gets completely mangled and we get the weirdexpected expression before '#pragma'
error.If you try this same code block with >=12.1 the #pragmas are correctly placed and compilation is fine.
I expected the following
libcurl macros need to be rewritten to handle this case for GCC < 12.1
curl/libcurl version
7.88.1
operating system
Proprietary platform, however this is a compilation issue so that shouldn't matter.
The text was updated successfully, but these errors were encountered: