Re: stdnoreturn: fix for Cygwin

2017-08-16 Thread Eric Blake
On 08/16/2017 07:59 PM, Eric Blake wrote:
> Adding cygwin list...
> 
> On 08/16/2017 07:01 PM, Bruno Haible wrote:
>> On Cygwin 1.7.30, I'm seeing this testdir build failure, when compiling
>> test-stdnoreturn.c:
>>
>> /usr/include/stdlib.h:66:28: error: expected ‘,’ or ‘;’ before ‘)’ token
>>  _VOID _EXFUN(abort,(_VOID) _ATTRIBUTE ((noreturn)));
> 
>> +
>> +   Similarly, on Cygwin, standard include files contain declarations like
>> + void __cdecl abort (void) __attribute__ ((noreturn));
>> +   "#define noreturn _Noreturn" would cause this declaration to be rewritten
>> +   to the invalid
>> + void __cdecl abort (void) __attribute__ ((__attribute__ 
>> ((__noreturn__;
> 
> Hmm. It's evil for any system .h file to ever use
> __attribute__((barename)), since barename is in the user's namespace and
> can therefore be defined to anything else, possibly breaking the header
> (as you just proved).  Hopefully, the problem goes away if cygwin
> patches its headers to use __attribute__((__noreturn__)), so that gnulib
> can then define noreturn at will.
> 
> I'll look into patching Cygwin to fix all barename attributes I can find
> that should be __barename__ instead.

On a closer look, I've already done this, several years ago (although a
few more have crept in since then):
https://cygwin.com/git/gitweb.cgi?p=newlib-cygwin.git;a=commitdiff;h=ada456dcf

Bruno, your cygwin installation of 1.7.30 is old, compared to current 2.8.2

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.   +1-919-301-3266
Virtualization:  qemu.org | libvirt.org



signature.asc
Description: OpenPGP digital signature


Re: stdnoreturn: fix for Cygwin

2017-08-16 Thread Eric Blake
Adding cygwin list...

On 08/16/2017 07:01 PM, Bruno Haible wrote:
> On Cygwin 1.7.30, I'm seeing this testdir build failure, when compiling
> test-stdnoreturn.c:
> 
> /usr/include/stdlib.h:66:28: error: expected ‘,’ or ‘;’ before ‘)’ token
>  _VOID _EXFUN(abort,(_VOID) _ATTRIBUTE ((noreturn)));

> +
> +   Similarly, on Cygwin, standard include files contain declarations like
> + void __cdecl abort (void) __attribute__ ((noreturn));
> +   "#define noreturn _Noreturn" would cause this declaration to be rewritten
> +   to the invalid
> + void __cdecl abort (void) __attribute__ ((__attribute__ 
> ((__noreturn__;

Hmm. It's evil for any system .h file to ever use
__attribute__((barename)), since barename is in the user's namespace and
can therefore be defined to anything else, possibly breaking the header
(as you just proved).  Hopefully, the problem goes away if cygwin
patches its headers to use __attribute__((__noreturn__)), so that gnulib
can then define noreturn at will.

I'll look into patching Cygwin to fix all barename attributes I can find
that should be __barename__ instead.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.   +1-919-301-3266
Virtualization:  qemu.org | libvirt.org



signature.asc
Description: OpenPGP digital signature