[Mingw-users] snprintf and %hhx format

Back to archive index
Keith Marshall keith****@users*****
Thu Jul 4 22:53:51 JST 2019


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <https://lists.osdn.me/mailman/archives/mingw-users/attachments/20190704/3c08f254/attachment.sig>


More information about the MinGW-Users mailing list
Back to archive index