Re: [pushed] gdb: Support printf 'z' size modifier

Simon Marchi
2019-11-14T17:09:41Z

On 2019-11-14 11:59 a.m., Eli Zaretskii wrote:
>> Date: Thu, 14 Nov 2019 16:49:45 +0000
>> From: Andrew Burgess <andrew.burgess@embecosm.com>
>> Cc: noreply@gnutoolchain-gerrit.osci.io, simon.marchi@polymtl.ca,
>> tromey@sourceware.org, palves@redhat.com, brobecker@adacore.com,
>> kevinb@redhat.com, gdb-patches@sourceware.org
>>
>> I guess there are a couple of solutions:
>>
>> 1. Remove all uses of %z from GDB, and back out the %z support, or
>>
>> 2. Have GDB translate %z into some other suitable format specifier
>> for targets where %z is not supported.
>>
>> Below is a patch that tries to take the second approach.
>
> Hmm... isn't it better to simply add -D__USE_MINGW_ANSI_STDIO=1 to the
> cpp flags when building with MinGW? I don't think there are versions
> of MinGW that don't support that macro.
>
> The effect of that macro is to link against a MinGW library that
> provides replacement implementations for *printf functions, and the
> replacements do support %z.
>

Apaprently, the __USE_MINGW_ANSI_STDIO macro has been marked as deprecated (IIUC, to
incite people not to define it directly), and I found this thread [1] on the mingw-users
mailing list where you asked the maintainer to reconsider this decision.

What is the status on that? If defining __USE_MINGW_ANSI_STDIO is not the right way
of enabling this feature, then what is? What is the status of this?

Simon

[1] https://osdn.net/projects/mingw/lists/archive/users/2019-January/thread.html#199
Subject "Deprecation of __USE_MINGW_ANSI_STDIO"