[PATCH] Add a few noreturn keywords
Marek Polacek
polacek@redhat.com
Tue Jan 10 13:04:00 GMT 2012
On 01/08/2012 07:25 PM, Ulrich Drepper wrote:
> This patch makes no sense. To be useful the prototypes should be marked.
Right, sorry. Updated version below. 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
which seems quite a bit odd, since in __pthread_exit we "call" __do_cancel,
which itself is noreturn... Perhaps a bug in GCC? So I'm not touching the
pthread_exit any more, at least for now. And wrt *longjmp*, all prototypes
are marked as noreturn already; it may be that GCC is confused by the
aliases.
BTW, wouldn't it be better to define `attribute_noreturn' which could
under C11 expand to _Noreturn keyword, otherwise to
__attribute__ ((noreturn))? Thanks,
2012-01-10 Marek Polacek <polacek@redhat.com>
* locale/programs/localedef.h (show_archive_content): Add noreturn
attribute.
--- libc/locale/programs/localedef.h.mp 2012-01-10 12:14:11.512419142 +0100
+++ libc/locale/programs/localedef.h 2012-01-10 12:14:40.705534134 +0100
@@ -178,6 +178,6 @@ extern int add_locales_to_archive (size_
extern int delete_locales_from_archive (size_t nlist, char *list[]);
/* List content of locale archive. */
-extern void show_archive_content (int verbose);
+extern void show_archive_content (int verbose) __attribute__ ((noreturn));
#endif /* localedef.h */
Marek
More information about the Libc-alpha
mailing list