Re: snprintf and %hhx format

Keith Marshall <[email protected]>
Newsgroups gmane.comp.gnu.mingw.user
Organization MinGW.org Project
Message-ID <[email protected]>
On 24/06/19 22:40, Keith Marshall wrote:
> On 06/05/19 16:30, Keith Marshall wrote:
>> On 06/05/19 03:38, Eli Zaretskii wrote:
>>>> From: Keith Marshall
>>>> Date: Sun, 5 May 2019 23:28:57 +0100
>>>>
>>>> FWIW, I can reproduce your results, but I don't see the same
>>>> effect, if I substitute a (properly adjusted) call to printf(),
>>>> in place of snprintf().  We may need to tweak <stdio.h>, to use
>>>> similar call redirection for snprintf(), as is currently used
>>>> for printf(), fprintf(), and sprintf().
>>>
>>> Thanks.  If you want me to try some patch, I can.
>>
>> I opened a ticket:
>> https://osdn.net/projects/mingw/ticket/39224
> 
> I'm thinking that we're about due for a new mingwrt/w32api release,
> (albeit only a bug-fix patch-level update).  I'd like to include this.

I've now pushed this change to the master repository, so it will be
included in the next (upcoming) mingwrt/w32api release.

On a somewhat related note, there _is_ actually a defect in the MinGW
implementation of -Wformat validation, for the __mingw_printf__ format
class; as I've noted on the ticket, it affects the "%hhn" conversion
specification, which, although fully supported by the underlying MinGW
printf implementation, is rejected by -Wformat validation, resulting in
an unhelpfully obtuse diagnostic message — as I discovered by running
the mingwrt test-suite with -Wall included in the CFLAGS.

Fixing this is trivial, but does require a tedious GCC rebuild, which I
now have in hand.

-- 
Regards,
Keith.

Public key available from keys.gnupg.net
Key fingerprint: C19E C018 1547 DE50 E1D4 8F53 C0AD 36C6 347E 5A3F

_______________________________________________
MinGW-Users mailing list
[email protected]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.osdn.me/mailman/listinfo/mingw-users
Also: mailto:[email protected]?subject=unsubscribe
signature.asc (application/pgp-signature, 836 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (GNU/Linux)

iQIcBAEBAgAGBQJdHgTvAAoJEMCtNsY0flo/ZnMQALuu6f0Iackq9e7MJKSXgxo5
9H5VKKO41Vv0EKwRF810WvCWtvpeH18D90ifttao7gJkCSYgeDxFR6CvDOYJ2GxQ
iMc2bWWnH20lFIRwtUHG5g0FRRaz7yKiNirUdFVr+YzOOtBougNU1DAYeWACzd8C
JAVpkWdAvEqD+mdbqznHwU7Cn+/yA/XmHVI1cTToIlJizwzkJDZUQ6fKtdMvLx4X
k38NNHsLEBm6exOPt2mMKgwSnbVbAKdig0oObVG86GSGdn2l33H/ko8bBzd7TgqH
tEtc/8r+PGSIA3y1IKBMY2jVPhIHIEdUiI4jK9dPt78lyZqSOp43/0D99E9um2Os
VQpbrIjVbD/lh4jg8iD5eZ9MsYYcPRjiYWCk8VdrepeXtPrcFna+Y5pzSNM9Ze8Q
2BTCaCEART/IPniZO5K2JJBcA6RRlN0VBw6ukBfrrEoW6HpOAZmFj9P5x64cEige
NqG/Ejs6YlpX9QoAM1wCqyB3sIpnjlrwGaBMC6NfOyB+VyQunCX6mxic8PNzmb6P
SurerBY1BsMwGHzRl/j9PWUwzuIxCozAXWX5yDYc6FZjCA5Sn49aeEk1AXYLoQng
kvnwZ5ms1h2B3T1yKEHPYERshKCyk3jqZADKhFBBUuJ2kaF2RQzFHfWRcB4hmCBo
Y22PYIGFHIFrXYwNoH3y
=+GY+
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.