bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCH] stdio: fix probe on mingw under gcc 5.1


From: Eric Blake
Subject: Re: [PATCH] stdio: fix probe on mingw under gcc 5.1
Date: Fri, 22 May 2015 06:08:44 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

On 05/20/2015 11:01 PM, Paul Eggert wrote:
> Eric Blake wrote:
>> I'm still open to any cleaner test, easy enough to maintain.
> 
> All we care about is (1) is it MingW and (2) has it defined PRIdMAX to
> be "lld" or to be "I64d".  Is that right?  If so, the first we can tell
> via inspecting a predefined preprocessor macro, and the second we can
> tell by a horrible trick like this:

Horrible indeed - but I like it.

> 
> /* Do this test only on MingW.  */
> char PRIdMAX_is_I64d[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1];
> 
> which will give us a compile-time failure if PRIdMAX is "lld".

And compile time is always better than searching a .o.  I'll update my
patch along those lines, as well as test it (since I've got access to
mingw systems to reproduce if the fix works).  Thanks for the idea!

-- 
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]