include: avoid recursive macros - #20597
Closed
vszakats wants to merge 24 commits into
Closed
Conversation
vszakats
marked this pull request as draft
February 14, 2026 13:51
-Wdisabled-macro-expansion when possible
vszakats
force-pushed
the
cm-typecheck-vs-warningopt
branch
from
February 15, 2026 12:33
5d1fb1c to
c3e6870
Compare
-Wdisabled-macro-expansion when possible
vszakats
marked this pull request as ready for review
February 15, 2026 13:07
vszakats
marked this pull request as draft
February 15, 2026 14:45
Member
Author
|
CM libressl Fil-C: https://github.com/curl/curl/actions/runs/22039030172/job/63676732424?pr=20597#step:42:45 CM clang HTTP/3 clang-tidy: https://github.com/curl/curl/actions/runs/22039030164/job/63676732284?pr=20597#step:11:77 linux-mingw, CM clang-tidy: https://github.com/curl/curl/actions/runs/22041102952/job/63682054988?pr=20597#step:8:103 |
…her things" This reverts commit 68b3f4e.
impossible to enforce, as it can happen in 3rd-party headers, e.g. in OpenSSL 3 ones, and Fil-C <signal.h>.
This reverts commit de08f1b. That wasn't the issue. Move to tidy-up PR.
vszakats
marked this pull request as ready for review
February 15, 2026 19:50
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
vszakats
added a commit
to vszakats/curl
that referenced
this pull request
Feb 16, 2026
vszakats
added a commit
to vszakats/curl
that referenced
this pull request
Feb 23, 2026
To avoid breaking 3rd-party code reusing these symbols as C++ methods,
e.g. in CMake sources:
```
cmake/src/v4.0.0-b30653ae0c.clean/Source/cmCurl.cxx:119:24: error: expected unqualified-id
119 | ::CURLcode res = ::curl_easy_setopt(curl, CURLOPT_CAINFO, cafile.c_str());
| ^
```
Follow-up to daa6b27 curl#20597
vszakats
added a commit
that referenced
this pull request
Feb 23, 2026
To avoid breaking 3rd-party code reusing these symbols as C++ methods,
e.g. in CMake sources:
```
cmake/src/v4.0.0-b30653ae0c.clean/Source/cmCurl.cxx:119:24: error: expected unqualified-id
119 | ::CURLcode res = ::curl_easy_setopt(curl, CURLOPT_CAINFO, cafile.c_str());
| ^
```
Also expand comment to highlight the case.
Reported-by: Kai Pastor
Bug: daa6b27#r177869049
Reported-by: Marcel Raad
Bug: https://curl.se/mail/lib-2026-02/0020.html
Fixes #20682
Follow-up to daa6b27 #20597
Closes #20686
vszakats
added a commit
that referenced
this pull request
Mar 21, 2026
…orce 3 args Certain uses may still trigger a C compiler warning `-Wdisabled-macro-expansion` after this, e.g. when the call is wrapped in the `CURL_IGNORE_DEPRECATION()` macro as seen in docs/examples. Suggested-by: Kai Pastor Ref: #20682 (comment) Follow-up to ee9b000 #20686 Follow-up to daa6b27 #20597 Closes #20709
outcast36
pushed a commit
to greearb/curl
that referenced
this pull request
Jun 3, 2026
To avoid breaking 3rd-party code reusing these symbols as C++ methods,
e.g. in CMake sources:
```
cmake/src/v4.0.0-b30653ae0c.clean/Source/cmCurl.cxx:119:24: error: expected unqualified-id
119 | ::CURLcode res = ::curl_easy_setopt(curl, CURLOPT_CAINFO, cafile.c_str());
| ^
```
Also expand comment to highlight the case.
Reported-by: Kai Pastor
Bug: curl@daa6b27#r177869049
Reported-by: Marcel Raad
Bug: https://curl.se/mail/lib-2026-02/0020.html
Fixes curl#20682
Follow-up to daa6b27 curl#20597
Closes curl#20686
outcast36
pushed a commit
to greearb/curl
that referenced
this pull request
Jun 3, 2026
…orce 3 args Certain uses may still trigger a C compiler warning `-Wdisabled-macro-expansion` after this, e.g. when the call is wrapped in the `CURL_IGNORE_DEPRECATION()` macro as seen in docs/examples. Suggested-by: Kai Pastor Ref: curl#20682 (comment) Follow-up to ee9b000 curl#20686 Follow-up to daa6b27 curl#20597 Closes curl#20709
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
To fix potential
-Wdisabled-macro-expansionwarnings when using thesemacros within other macros. Fixing for example:
Also update comments on why curl continues to disable
-Wdisabled-macro-expansionand-Wused-but-marked-unusedwarnings.Follow-up to 92f215f #18477
Disabling this warning probably should be done regardless of
picky warnings enabled or not. That's likely true for other
nooptions too, thus not tackled in this PR.
pop up due to 3rd-party headers, e.g. Linux glibc (
stdio/stderr),MUSL (
sa_handler) and in OpenSSL 3 (due toossl_unusedusedin its public headers). Meaning it's not possible to enable these.