[PATCH] openat-die: use _Noreturn markup

Eric Blake eblake@redhat.com
Thu Jul 31 04:22:00 GMT 2014


On 07/30/2014 09:53 PM, Eric Blake wrote:

> 
> Meanwhile, './gnulib-tool --test stdnoreturn' is failing on cygwin, so
> I'm trying to track down why.
> 
> In file included from /usr/include/stdlib.h:11:0,
>                  from ../../gltests/test-stdnoreturn.c:23:
> ./../config.h:33:21: error: expected '(' before '__attribute__'
>  #  define _Noreturn __attribute__ ((__noreturn__))
>                      ^
> 

Oh, I think I see the problem.  Pasting more of the error message:

/usr/include/stdlib.h:66:28: error: expected ',' or ';' before ')' token
 _VOID _EXFUN(abort,(_VOID) _ATTRIBUTE ((noreturn)));
                            ^

Looks like the cygwin headers are broken for misusing 'noreturn' instead
of __noreturn__ inside __attribute__; something that is easier to patch
in cygwin than work around in gnulib.

For more proof:

$ printf '#include <stdnoreturn.h>\n#include <stdlib.h>\n' \
  | gcc -xc -E - | grep abort
void __attribute__((__cdecl__)) abort (void) __attribute__ ((_Noreturn));
$ printf '#include <stdnoreturn.h>\n#include <stdlib.h>\n' \
  | gcc -xc -E - -D_Noreturn='__attribute__((__noreturn__))' \
  | grep abort
void __attribute__((__cdecl__)) abort (void) __attribute__
((__attribute__((__noreturn__))));



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

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


More information about the Cygwin mailing list