bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [libvirt] [PATCH] Define __USE_MINGW_ANSI_STDIO in config.h


From: Eric Blake
Subject: Re: [libvirt] [PATCH] Define __USE_MINGW_ANSI_STDIO in config.h
Date: Mon, 08 Dec 2014 16:39:21 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0

On 12/08/2014 04:14 PM, Eric Blake wrote:
> where, if no fprintf module is used, then we are FORCING the system
> printf format, so gcc thinks that %lld is unsupported - but at the same
> time, mingw's <inttypes.h> has conditional logic that defines PRIdMAX to
> "lld" instead of "I64d" when we have turned on proper printf.
> 
> It looks like we need to rethink the logic in stdio.h to unconditionally
> use __gnu_printf__ when we are sure that the mingw define actually makes
> a difference, so that the rest of the code base can just blindly use %lld.

At this point, I'm thinking the stdio module needs a configure-time test
to see whether PRIdMAX is equivalent to "lld" or not, and set a witness
preprocessor variable that stdin.in.h then uses to decide between blind
use of __gnu_printf__ vs. system __printf__ attributes (since we still
want to work on older mingw, that lacks the newer mingw64 magic for
supporting %lld).  Bummer that the preprocessor can't do string
comparison natively.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]