This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] openat-die: use _Noreturn markup


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

Attachment: signature.asc
Description: OpenPGP digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]