Repository navigation
Conversation
vszakats
marked this pull request as draft
January 19, 2026 22:25
-Wc99-extensions with C89 and Apple clang
-Wc99-extensions with C89 and Apple clang
vszakats
added a commit
that referenced
this pull request
Jan 20, 2026
Extend two existing local suppressions to GCC, and add another
GCC-specific one as a replacement.
Before this patch suppressing this warning was odd with clang, because
after this option, `-Wformat=2` is used, which re-enables it.
Also:
- mprintf: minimize scope of a warning suppression.
- tests/server: suppress this warning for a system `vsnprintf()` call
where it could trigger in C89 builds or with
`CFLAGS=-DCURL_NO_FMT_CHECKS` set. Seen with Apple clang 17:
```
curl/tests/server/util.c:114:37: warning: format string is not a string literal [-Wformat-nonliteral]
114 | vsnprintf(buffer, sizeof(buffer), msg, ap);
| ^~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h:124:69: note: expanded from macro 'vsnprintf'
124 | #define vsnprintf(str, len, ...) __vsnprintf_chk_func (str, len, 0, __VA_ARGS__)
| ^~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h:81:65: note: expanded from macro '__vsnprintf_chk_func'
81 | __builtin___vsnprintf_chk (str, len, flag, __darwin_obsz(str), format, ap)
| ^~~~~~
```
Ref: #20363
Closes #20366
This reverts commit 5390e18.
Reverts e8189c4 curl#20362
vszakats
marked this pull request as ready for review
January 20, 2026 11:48
vszakats
added a commit
to vszakats/curl
that referenced
this pull request
Mar 12, 2026
vszakats
added a commit
that referenced
this pull request
Mar 12, 2026
- tool_getparam: revert an unnecessary/no-op C89 warning silencer. Follow-up to 09c9afd #20363 - tool_writeout: add comment saying silencing is a no-op for llvm/clang. For `strftime()` it is a GCC-specific, as of llvm/clang v22.1.0. Follow-up to f07a98a #20366 - unit1652: drop always-false `!defined(__clang__)` guard. Pointed-out-by: Orgad Shaneh Ref: #20902 Follow-up to 7e814c8 #16062 - unit1652: document that `-Wformat` is necessary for GCC v5 to v8. Follow-up to 71cf0d1 #14772 Closes #20908
vszakats
added a commit
that referenced
this pull request
Mar 19, 2026
From Apple clang-only prior to this patch.
Silencing (seen after macos-15 runner accidentally switched to
llvm/clang by default):
```
/Users/runner/work/curl/curl/lib/curlx/warnless.h:64:1: error: '_Bool' is a C99 extension [-Werror,-Wc99-extensions]
64 | bool curlx_sztouz(ssize_t sznum, size_t *puznum);
| ^
/opt/homebrew/Cellar/llvm@18/18.1.8/lib/clang/18/include/stdbool.h:20:14: note: expanded from macro 'bool'
20 | #define bool _Bool
| ^
[...]
```
Ref: https://github.com/curl/curl/actions/runs/23304345180/job/67774031335?pr=21014#step:11:39
Follow-up to 09c9afd #20363
Ref: actions/runner-images#13827
Closes #21015
vszakats
added a commit
that referenced
this pull request
Apr 8, 2026
outcast36
pushed a commit
to greearb/curl
that referenced
this pull request
Jun 3, 2026
- tool_getparam: revert an unnecessary/no-op C89 warning silencer. Follow-up to 09c9afd curl#20363 - tool_writeout: add comment saying silencing is a no-op for llvm/clang. For `strftime()` it is a GCC-specific, as of llvm/clang v22.1.0. Follow-up to f07a98a curl#20366 - unit1652: drop always-false `!defined(__clang__)` guard. Pointed-out-by: Orgad Shaneh Ref: curl#20902 Follow-up to 7e814c8 curl#16062 - unit1652: document that `-Wformat` is necessary for GCC v5 to v8. Follow-up to 71cf0d1 curl#14772 Closes curl#20908
outcast36
pushed a commit
to greearb/curl
that referenced
this pull request
Jun 3, 2026
From Apple clang-only prior to this patch.
Silencing (seen after macos-15 runner accidentally switched to
llvm/clang by default):
```
/Users/runner/work/curl/curl/lib/curlx/warnless.h:64:1: error: '_Bool' is a C99 extension [-Werror,-Wc99-extensions]
64 | bool curlx_sztouz(ssize_t sznum, size_t *puznum);
| ^
/opt/homebrew/Cellar/llvm@18/18.1.8/lib/clang/18/include/stdbool.h:20:14: note: expanded from macro 'bool'
20 | #define bool _Bool
| ^
[...]
```
Ref: https://github.com/curl/curl/actions/runs/23304345180/job/67774031335?pr=21014#step:11:39
Follow-up to 09c9afd curl#20363
Ref: actions/runner-images#13827
Closes curl#21015
outcast36
pushed a commit
to greearb/curl
that referenced
this pull request
Jun 3, 2026
Syncing with CMake. Follow-up to 43397b0 curl#21015 Follow-up to 09c9afd curl#20363 Closes curl#21263
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.
stdbool.his also included via system headers. Disabling it from curldoes not fix it. Silencing lots of these:
silence
-Wcommawarnings.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 tool_getparam: avoid
-Wcommawith Apple clang in C89 mode #20362Also:
Ref: https://cmake.org/cmake/help/v3.7/variable/CMAKE_C_STANDARD.html
-Wformat-nonliteral, fix fallouts #20366