tool_getparam: avoid -Wcomma with Apple clang in C89 mode#20362
Closed
vszakats wants to merge 1 commit intocurl:masterfrom
Closed
tool_getparam: avoid -Wcomma with Apple clang in C89 mode#20362vszakats wants to merge 1 commit intocurl:masterfrom
-Wcomma with Apple clang in C89 mode#20362vszakats wants to merge 1 commit intocurl:masterfrom
Conversation
```
src/tool_getparam.c:3062:12: warning: possible misuse of comma operator here [-Wcomma]
3062 | for(i = 1, stillflags = TRUE; i < argc && !result; i++) {
| ^
src/tool_getparam.c:3062:7: note: cast expression to void to silence warning
3062 | for(i = 1, stillflags = TRUE; i < argc && !result; i++) {
| ^~~~~
| (void)( )
```
Member
Candidate for most silly warning in 2026... |
Member
Author
It's silly, yes. Seen with Apple clang. |
-Wcomma with Apple clang in C89 mode
vszakats
added a commit
to vszakats/curl
that referenced
this pull request
Jan 20, 2026
Reverts e8189c4 curl#20362
1 task
vszakats
added a commit
to vszakats/curl
that referenced
this pull request
Jan 20, 2026
Reverts e8189c4 curl#20362
vszakats
added a commit
that referenced
this pull request
Jan 20, 2026
- `stdbool.h` is also included via system headers. Disabling it from curl
does not fix it. Silencing lots of these:
```
curl/lib/curlx/warnless.h:64:1: warning: '_Bool' is a C99 extension [-Wc99-extensions]
64 | bool curlx_sztouz(ssize_t sznum, size_t *puznum);
| ^
/Library/Developer/CommandLineTools/usr/lib/clang/17/include/stdbool.h:24:14: note: expanded from macro 'bool'
24 | #define bool _Bool
| ^
```
- silence `-Wcomma` warnings.
in favor of the global silencing approach, since a couple of more of
these were hit (in vquic, tool1622, unit1309, unit1636), and it seems
silly to update them all.
Revert e8189c4 #20362
Also:
- cmake: include C standard in 'platform flags' log line.
- GHA/macos: switch a job to C89 to verify.
- GHA/linux: show 'C89' in job names.
Ref: https://cmake.org/cmake/help/v3.7/variable/CMAKE_C_STANDARD.html
Closes #20363
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.
Seen with Apple clang 17: