[Top][All Lists]
[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>
- [PATCH] test-raise: use _Noreturn, Bernhard Voelker, 2011/10/05
- Re: [PATCH] test-raise: use _Noreturn, Bruno Haible, 2011/10/05
- Re: [PATCH] test-raise: use _Noreturn, Eric Blake, 2011/10/05
- Re: [PATCH] test-raise: use _Noreturn, Eric Blake, 2011/10/05
- Re: [PATCH] test-raise: use _Noreturn,
Bruno Haible <=
- Re: [PATCH] test-raise: use _Noreturn, Bernhard Voelker, 2011/10/06
- Re: [PATCH] test-raise: use _Noreturn, Bruno Haible, 2011/10/06
- Re: [PATCH] test-raise: use _Noreturn, Bernhard Voelker, 2011/10/06
- Re: [PATCH] test-raise: use _Noreturn, Paolo Bonzini, 2011/10/07
- Re: [PATCH] test-raise: use _Noreturn, Bruno Haible, 2011/10/07