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: Tue, 26 May 2015 14:54:47 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

On 05/26/2015 02:21 PM, Eric Blake wrote:
> On 05/26/2015 01:49 PM, Assaf Gordon wrote:
>> Hello,
>>
>> I'm encountering a similar/related issue with PRIdMAX on mingw32-gcc 4.8.2.
>>

> 
> Okay, so that's a version of mingw new enough to honor
> __USE_MINGW_ANSI_STDIO, and a version of gcc old enough that the
> existing probe in m4/stdio_h.m4 should be detecting that "lld" is supported.
> 

> 
> Hmm - the gnulib override to turn on __USE_MINGW_ANSI_STDIO lives in
> <config.h> as part of the 'extensions' module, so it should be on at
> this point, and you _should_ be seeing "lld".  Is this a case of the
> configure test guessing wrong?
> 
> Oh, maybe I see it - the 'inttypes' module does NOT require the
> 'extensions' module.  But based on this argument, it should.

Even weirder, the extensions module alone is not enough to make mingw
confess its sins.  It turns out that <inttypes.h> in isolation doesn't
swap definitions on mingw; it is only the combination of <inttypes.h>
plus <stdio.h> (in either order):

$ a='#define __USE_MINGW_ANSI_STDIO 1\n'
$ b='#include <inttypes.h>\n'
$ c='PRIdMAX\n'
$ printf "$a$b$c" | x86_64-w64-mingw32-gcc -E - | tail -n1
"I64d"
$ printf "$a#include <stdio.h>\n$b$c" | \
  x86_64-w64-mingw32-gcc -E - | tail -n1
"lld"
$ printf "$a$b#include <stdio.h>\n$c" | \
  x86_64-w64-mingw32-gcc -E - | tail -n1
"lld"

At any rate, I'll fold this into my updated patch.

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