bug-gnulib
[Top][All Lists]
Advanced

[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 21:53:17 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0

On 07/30/2014 03:25 PM, Eric Blake wrote:
> Compiling coreutils.git on cygwin with gcc 4.8.3, I got:
> 
> lib/openat-die.c:34:1: error: function might be candidate for attribute 
> 'noreturn' [-Werror=suggest-attribute=noreturn]
>  openat_save_fail (int errnum)
>  ^
> 
> * modules/openat-die (Depends-on): Add stdnoreturn.
> * lib/openat-die.c (openat_save_fail, openat_restore_fail): Mark
> _Noreturn.
> 
> Signed-off-by: Eric Blake <address@hidden>
> ---
> 
> I noticed that the c-stack module does NOT depend on the stdnoreturn
> modules, and that lib/c-stack.c does not include <stdnoreturn.h> but
> DOES use _Noreturn.  Therefore, I'm not 100% sure that this patch is
> right, and if we need to touch up other modules that are using
> _Noreturn improperly; vs. this patch being too complex and I could
> just simplify it to be more like c-stack.c.  I _think_ c-stack.c was
> getting a guaranteed _Noreturn by virtue of (indirectly) getting
> a definition from the stdlib module using snippet/_Noreturn.

Okay, after a bit more research, I see that _Noreturn is either a
keyword (new enough C11 compiler) or faked by snippet/_Noreturn (where
it can be pulled in explicitly in a module, but some modules are relying
on it being present indirectly).  Use of <stdnoreturn.h> merely provides
'noreturn' as a synonym, so it is overkill for my proposed patch.  I'll
try another version.

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__))
                     ^

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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]