Send MinGW-Notify mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.osdn.me/mailman/listinfo/mingw-notify
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of MinGW-Notify digest..."
Please do not reply to this notification; the sender address is unable to
accept incoming e-mail. If you wish to unsubscribe you can do so at
https://lists.osdn.me/mailman/listinfo/mingw-notify.
Today's Topics:
1. [mingw] #39224: GCC-7.3 and later apply wrong -Wformat
attributes for snprintf() and vsnprintf() functions
(MinGW Notification List)
----------------------------------------------------------------------
Message: 1
Date: Fri, 05 Jul 2019 11:18:09 +0100
From: MinGW Notification List <[email protected]>
To: OSDN Ticket System <[email protected]>
Subject: [MinGW-Notify] [mingw] #39224: GCC-7.3 and later apply wrong
-Wformat attributes for snprintf() and vsnprintf() functions
Message-ID: <[email protected]>
Content-Type: text/plain; charset=UTF-8
#39224: GCC-7.3 and later apply wrong -Wformat attributes for snprintf() and
vsnprintf() functions
Open Date: 2019-05-06 15:51
Last Update: 2019-07-05 11:18
URL for this Ticket:
https://osdn.net//projects/mingw/ticket/39224
RSS feed for this Ticket:
https://osdn.net/ticket/ticket_rss.php?group_id=3917&tid=39224
---------------------------------------------------------------------
Last Changes/Comment on this Ticket:
2019-07-05 11:18 Updated by: keith
* Status Update from Open to Closed
* Resolution Update from None to Fixed
Comment:
The -Wformat mishandling of "%hhn" is corrected from release 4-mingw32 of
GCC-8.2.0 onwards; at present, I do not plan to back-port to GCC-7.3.0 .
The inappropriate effect of interaction with GCC's built-in snprintf() and
vsnprintf() prototypes is corrected by commit #21718ad; this will be included
in the next mingwrt/w32api release.
---------------------------------------------------------------------
Ticket Status:
Reporter: keith
Owner: keith
Type: Issues
Status: Closed
Priority: 5 - Medium
MileStone: (None)
Component: WSL
Severity: 5 - Medium
Resolution: Fixed
---------------------------------------------------------------------
Ticket details:
As originally reported by Eli Zaretskii, in this mingw-users mail posting, use
of ISO-C99 standard format specifications, such as "%02hhx", (which is not
understood by Microsoft's MSVCRT.DLL family of printf() functions), in calls to
snprintf() may result in unexpected compile-time warning diagnostics, when
compiled with any warning option, such as -Wall, which implicitly (or even
explicitly) enables -Wformat.
The issue appears to be caused by GCC's use of an internal prototype, for
snprintf(), which seems to arbitrarily assume Microsoft's -Wformat semantics,
(even though Microsoft have never provided a snprintf() implementation, in any
version of the system-supplied MSVCRT.DLL runtime library, on which every
MinGW-GCC compiler build is dependent). The issue does not arise when calls to
snprintf() are replaced by its equivalent __mingw_snprintf(), (which is
explicitly declared as exhibiting MinGW's -Wformat semantics); nor does it
arise when GCC's internal prototype is overridden, (by use of the
-fno-builtin-snprintf option), and thus the <stdio.h> prototype, (which also
explicitly exhibits MinGW's -Wformat semantics), becomes applicable.
It is anticipated that the vsnprintf() implementation will be similarly
affected.
--
Ticket information of MinGW - Minimalist GNU for Windows project
MinGW - Minimalist GNU for Windows Project is hosted on OSDN
Project URL: https://osdn.net/projects/mingw/
OSDN: https://osdn.net
URL for this Ticket:
https://osdn.net/projects/mingw/ticket/39224
RSS feed for this Ticket:
https://osdn.net/ticket/ticket_rss.php?group_id=3917&tid=39224
------------------------------
Subject: Digest Footer
_______________________________________________
MinGW-Notify mailing list
[email protected]
https://lists.osdn.me/mailman/listinfo/mingw-notify
------------------------------
End of MinGW-Notify Digest, Vol 22, Issue 4
*******************************************