This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch bfd]: Fix printf formatter for mingw 1 of N


On 10/11/2012 06:36 PM, Ian Lance Taylor wrote:
> On Wed, Oct 10, 2012 at 11:37 PM, Kai Tietz <ktietz70@googlemail.com> wrote:
>> 2012/10/11 Alan Modra <amodra@gmail.com>:
>>>
>>> Are there really occurrences of %z in a printf format string?  I do
>>> see some %z in strings, but they aren't passed to printf.  Maybe I
>>> didn't look carefully enough.
>>
>> Sure, there are.  They are occuring all in gold.  This tool shall work
>> on windows-host AFAIU, so there is for sure an issue. (gold has also
>> many uses of %llx, too).
> 
> Are you saying that mingw doesn't support %z in a printf format
> string?  It's in C99, i.e., it has been standardized for over ten
> years.

It does, but not by default.  By default you get printf and friends
from Microsoft's C runtimes (msvcrt.dll and family).  As you may know, Microsoft's
toolchains implement little to no C99.  One can, however,
at least in the mingw.org mingw, choose to link to C99-aware printf&co
replacements: e.g., by defining _GNU_SOURCE or __USE_MINGW_ANSI_STDIO to 1
before including stdio.h (this defines printf to __mingw_printf, the
replacement).

-- 
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]