-
-
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
printf: fix mingw-w64 format checks, take 2 #14703
Closed
Closed
Conversation
This file contains 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
This comment was marked as resolved.
This comment was marked as resolved.
system.h: use __format__ instead of format with MINGW curl_setup.h move below stdio.h
This reverts commit 22e28da.
vszakats
force-pushed
the
mingw-printf-alt-test
branch
from
September 1, 2024 01:23
53ec734
to
120f28c
Compare
vszakats
changed the title
[TEST] mingw printf alt test
[TEST] mingw printf format check alternate fix
Sep 1, 2024
vszakats
changed the title
[TEST] mingw printf format check alternate fix
[TEST] printf: fix mingw-w64 format checks, take 2
Sep 1, 2024
vszakats
changed the title
[TEST] printf: fix mingw-w64 format checks, take 2
printf: fix mingw-w64 format checks, take 2
Sep 1, 2024
Made this PR work on the second attempt. |
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.
Change mingw-w64 printf format checks in public curl headers to use
__MINGW_PRINTF_FORMAT
instead ofgnu_printf
. This syncs the formatchecker with format string macros published via
curl/system.h
. (Alsodisable format checks for mingw-w64 older than 3.0.0 (2013-09-20) and
classic-mingw, which do not support this macro.)
This fixes bogus format checker
-Wformat
warnings in 3rd party codeusing curl format strings with the curl printf functions, when using
mingw-w64 7.0.0 (2019-11-10) and older (with GCC, MSVCRT).
It also allows to delete two workaounds for this within curl itself:
-D__USE_MINGW_ANSI_STDIO=1
for mingw-w64 via cmake andconfigure for
docs/examples
andtests/http/clients
.Ref: c730c85 build: make
CURL_FORMAT_CURL_OFF_T[U]
work with mingw-w64 <=7.0.0 #14640The format check macro is incompatible (depending on mingw-w64 version
and configuration) with the C99
%z
(size_t
) format string usedinternally by curl.
To work around this problem, override the format check style in curl
public headers to use
gnu_printf
. This is compatible with%z
in allmingw-w64 versions and allows keeping the C99 format strings internally.
Also:
Ref: #14643 (take 1)
Follow-up to 3829759 #12489
CURL_TEMP_PRINTF
a better name? And/or its internal counterpart.