build: opt-in MSVC to C99-style verbose logging logic#20387
Closed
vszakats wants to merge 1 commit intocurl:masterfrom
Closed
build: opt-in MSVC to C99-style verbose logging logic#20387vszakats wants to merge 1 commit intocurl:masterfrom
vszakats wants to merge 1 commit intocurl:masterfrom
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
vszakats
added a commit
that referenced
this pull request
Jan 21, 2026
- schannel: fix mixed-up declaration. (originally fenced infof for verbose, then changed to failf with the fence kept, then fence removed and variable marked as verbose, when in fact it's not, but not tested and caught in CI. - fix two other fallouts. - GHA/windows: disable verbose strings in a mingw job. - appveyor: disable verbose strings in an MSVC job. - appveyor: add way to pass any CMake option per-job. Cherry-picked from #20387 Follow-up to 61093e2 #20353 Closes #20388
MSVC doesn't advertise itself as C99 via `__STDC_VERSION__`, but supports variadic macros in all supported versions? CI will tell. Suggested-by: Arnav Purushotam Ref: curl#20367 Follow-up to 61093e2 curl#20353
c4dfc3c to
21ac5ad
Compare
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.
MSVC does not advertise itself as C99 via
__STDC_VERSION__, butsupports variadic macros in all curl-supported versions. Fix by
explicitly enabling C99 verbose string logic for MSVC.
With verbose logging enabled (default), this makes logging perform
better, on par with clang/gcc (and other C99) builds. (With the cost
of extra binary size.) With verbose logging disabled, it excludes all
verbose logging related strings and code from the binary. Before this
patch, MSVC used the C89 fallback code in both configs, which used
a fixed function call, with the called function deciding to actually
log or not, while also retaining the verbose log string in both configs.
Size comparison (bytes), schannel, static, debug, VS2022, local build:
curl-before-verbose.exe 4,024,832
curl-before-noverbose.exe 4,013,056
curl-after-verbose.exe 4,117,504
curl-after-noverbose.exe 3,928,064
In CI with non-verbose:
Before:
Ref: https://ci.appveyor.com/project/curlorg/curl/builds/53408629/job/htj7ps88q83ew9ww#L224
After:
Ref: https://ci.appveyor.com/project/curlorg/curl/builds/53408771/job/tp9epgjpef098vsr#L224
Idea-by: Arnav Purushotam
Ref: #20367
Ref: #20341
Follow-up to 61093e2 #20353