[PATCH] Add a few noreturn keywords

Ulrich Drepper drepper@gmail.com
Wed Jan 11 02:46:00 GMT 2012


On Tue, Jan 10, 2012 at 06:31, Marek Polacek <polacek@redhat.com> wrote:
> However, when I added the
> noreturn attribute to __pthread_exit in pthreadP.h, GCC started to
> complain:
> forward.c:164:1: warning: ‘noreturn’ function does return

Look at the patch I checked in.  That should fix the issue but since I
don't use 4.7 I cannot verify.


> And wrt *longjmp*, all prototypes
> are marked as noreturn already; it may be that GCC is confused by the
> aliases.

I don't know where you see a problem.  Run the code through the
preprocessor and look at all the relevant pieces.


> BTW, wouldn't it be better to define `attribute_noreturn' which could
> under C11 expand to _Noreturn keyword, otherwise to
> __attribute__ ((noreturn))?  Thanks,

Completely irrelevant for all the internal prototypes.  gcc will
always be required.

For the ones in installed headers I see a problem with the placement.
Unless all gcc versions are guaranteed to allow the attribute to be
added in the same place as _Noreturn is required there will be no
change.



More information about the Libc-alpha mailing list