stdnoreturn: fix for Cygwin

Eric Blake eblake@redhat.com
Thu Aug 17 01:00:00 GMT 2017


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://cygwin.com/pipermail/cygwin/attachments/20170817/38de290d/attachment.sig>


More information about the Cygwin mailing list