[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] openat-die: use _Noreturn markup
From: |
Eric Blake |
Subject: |
Re: [PATCH] openat-die: use _Noreturn markup |
Date: |
Wed, 30 Jul 2014 22:22:06 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 |
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
signature.asc
Description: OpenPGP digital signature