bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] test-raise: use _Noreturn


From: Bruno Haible
Subject: Re: [PATCH] test-raise: use _Noreturn
Date: Thu, 6 Oct 2011 01:14:24 +0200
User-agent: KMail/1.13.6 (Linux/2.6.37.6-0.5-desktop; KDE/4.6.0; x86_64; ; )

Eric Blake wrote:
> Shouldn't that imply that gnulib's <stdlib.h> replacement should be
> taught to guarantee that exit() is declared noreturn even if the
> system's header is missing that information?

Yes, this would be a good idea.

> Or, avoiding a change to gnulib's <stdlib.h>, why not use this?
> 
> static _Noreturn void
> handler (int sig)
> {
>    while (1)
>      exit (0);
> }
> 
> That is, the while(1) construct should be sufficient for gcc to detect 
> an infloop condition which is another way to satisfy handler's noreturn 
> marking, even if exit() itself was not marked noreturn.

Yes, this should work too. But it smells the hack, therefore I would
prefer your first idea.

Bruno
-- 
In memoriam Annalena Tonelli <http://en.wikipedia.org/wiki/Annalena_Tonelli>



reply via email to

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