From 67625762b4c953594c120c8a1798fe4bdf536bfc Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Fri, 15 Feb 2019 09:52:06 -0800
Subject: [PATCH] Prefer _Noreturn to __attribute__ ((noreturn))
* benchtests/bench-stpcpy_chk.c, benchtests/bench-strcpy_chk.c:
* debug/chk_fail.c, debug/test-stpcpy_chk.c:
* debug/test-strcpy_chk.c, elf/dl-minimal.c, include/sys/cdefs.h:
(__chk_fail):
* crypt/cert.c (good_bye):
* csu/init-first.c (_dl_start):
* csu/libc-start.c (LIBC_START_MAIN):
* csu/version.c (__libc_main):
* debug/fortify_fail.c (__fortify_fail_abort, __fortify_fail):
* debug/stack_chk_fail.c (__stack_chk_fail):
* debug/stack_chk_fail_local.c (__stack_chk_fail)
(__stack_chk_fail_local):
* elf/dl-error-skeleton.c (fatal_error):
* elf/dl-exception.c (length_mismatch):
* elf/dl-load.c (lose):
* elf/dl-tls.c (oom):
* elf/nodelete.c (handler):
* hurd/hurd.h (_hurd_exit):
* include/assert.h (__assert_fail, __asxsert_perror_fail)
(__assert_fail_base):
* include/setjmp.h (__longjmp, ____longjump_chk)
(__libc_siglongjmp, __libc_longjmp):
* include/stdio.h (__libc_message):
* include/unistd.h (_exit):
* locale/programs/localedef.h (show_archive_content):
* malloc/dynarray.h (__libc_dynarray_at):
* malloc/malloc.c (malloc_printerr):
* malloc/mcheck.c (mabort):
* malloc/tst-interpose-aux.c (fail):
* malloc/tst-mallocfork2.c (signal_sender):
* misc/bits/error.h (__error_noreturn, __error_at_line_noreturn):
* misc/err.h (err, verr, errx, verrx):
* nptl/createthread.c (START_THREAD_DEFN):
* nptl/forward.c (__pthread_unwind):
* nptl/pt-longjmp.c (longjmp_compat):
* nptl/pthreadP.h (__pthread_unwind, __pthread_unwind_next)
(__do_cancel, __pthread_exit):
* nptl/unwind.c (__pthread_unwind, __pthread_unwind_next):
* nptl/version.c (__nptl_main):
* nscd/connections.c (nscd_run_prune):
* nscd/nscd.c (invalidate_db, send_shutdown):
* nscd/nscd.h (termination_handler, start_threads)
(receive_print_stats):
* posix/unistd.h (_exit):
* resolv/gai_misc.c (handle_requests):
* setjmp/bits/setjmp2.h (longjmp, _longjmp, siglongjmp, __longjmp_chk):
* setjmp/setjmp.h (longjmp, _longjmp, siglongjmp):
* setjmp/tst-setjmp.c (jump):
* stdlib/exit.h (__run_exit_handlers):
* stdlib/stdlib.h (abort, exit, quick_exit, _Exit):
* stdlib/tst-random.c (fail):
* sunrpc/proto.h (_Noerror, crash):
* sunrpc/rpc_main.c (usage, options_usage):
* sunrpc/rpc_scan.h (expected1, expected2, expected3):
* sunrpc/svc_tcp.c (svctcp_rendezvous_abort):
* sunrpc/svc_unix.c (svcunix_rendezvous_abort):
* support/check.h (support_exit_failure)
(support_test_verify_exit_impl):
* support/support_test_main.c (signal_handler):
* sysdeps/arm/unwind.h (_Unwind_Resume):
* sysdeps/generic/exit-thread.h (__exit_thread):
* sysdeps/generic/ldsodefs.h (_dl_signal_exception)
(_dl_signal_error, _dl_reloc_bad_type):
* sysdeps/htl/pthread.h (pthread_exit):
* sysdeps/htl/pthreadP.h (__pthread_exit):
* sysdeps/ia64/jmpbuf-unwind.h (__libc_unwind_longjmp):
* sysdeps/nptl/futex-internal.h (futex_fatal_error):
* sysdeps/nptl/pthread.h (pthread_exit, __pthread_unwind_next):
* sysdeps/nptl/threads.h (thrd_exit):
* sysdeps/powerpc/longjmp.c (__vmx__longjmp, __vmx__libc_longjmp):
* sysdeps/powerpc/novmxsetjmp.h (__novmxlongjmp, __novmx_longjmp)
(__novmxsiglongjmp, __novmx__libc_longjmp):
* sysdeps/pthread/timer_routines.c (thread_func):
* sysdeps/unix/sysv/linux/createthread.c (START_THREAD_DEFN)
(start_thread):
* sysdeps/unix/sysv/linux/exit-thread.h (__exit_thread):
* sysdeps/unix/sysv/linux/generic/____longjmp_chk.c (____longjmp_chk):
* sysdeps/unix/sysv/linux/i386/startup.h (_startup_fatal):
* sysdeps/unix/sysv/linux/hppa/pthread.h (pthread_exit)
(__pthread_unwind_next):
* sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c (__ia64_longjmp):
* sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c (__sigstack_longjmp):
* sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c:
(__novmx__libc_siglongjmp, __novmx__libc_longjmp):
* sysdeps/unix/sysv/linux/s390/longjmp_chk.c (____longjmp_chk):
* sysdeps/x86/longjmp.c (__longjmp_cancel):
* sysdeps/x86/nptl/pt-longjmp.c (longjmp_compat):
Prefer _Noreturn to __attribute__ ((noreturn)) when either will do.
---
ChangeLog | 92 +++++++++++++++++++
assert/assert.h | 19 ++--
benchtests/bench-stpcpy_chk.c | 2 +-
benchtests/bench-strcpy_chk.c | 2 +-
crypt/cert.c | 2 +-
csu/init-first.c | 2 +-
csu/libc-start.c | 19 ++--
csu/version.c | 2 +-
debug/chk_fail.c | 3 +-
debug/fortify_fail.c | 6 +-
debug/stack_chk_fail.c | 3 +-
debug/stack_chk_fail_local.c | 4 +-
debug/test-stpcpy_chk.c | 2 +-
debug/test-strcpy_chk.c | 2 +-
elf/dl-error-skeleton.c | 3 +-
elf/dl-exception.c | 3 +-
elf/dl-load.c | 3 +-
elf/dl-minimal.c | 3 +-
elf/dl-tls.c | 3 +-
elf/nodelete.c | 3 +-
hurd/hurd.h | 2 +-
include/assert.h | 24 ++---
include/setjmp.h | 14 ++-
include/stdio.h | 9 +-
include/sys/cdefs.h | 2 +-
include/unistd.h | 4 +-
locale/programs/localedef.h | 4 +-
malloc/dynarray.h | 3 +-
malloc/malloc.c | 2 +-
malloc/mcheck.c | 3 +-
malloc/tst-interpose-aux.c | 3 +-
malloc/tst-mallocfork2.c | 3 +-
misc/bits/error.h | 19 ++--
misc/err.h | 16 ++--
nptl/createthread.c | 2 +-
nptl/forward.c | 2 +-
nptl/pt-longjmp.c | 2 +-
nptl/pthreadP.h | 14 +--
nptl/unwind.c | 8 +-
nptl/version.c | 3 +-
nscd/connections.c | 9 +-
nscd/nscd.c | 4 +-
nscd/nscd.h | 6 +-
posix/unistd.h | 2 +-
resolv/gai_misc.c | 3 +-
setjmp/bits/setjmp2.h | 25 ++---
setjmp/setjmp.h | 11 +--
setjmp/tst-setjmp.c | 2 +-
stdlib/exit.h | 8 +-
stdlib/stdlib.h | 8 +-
stdlib/tst-random.c | 2 +-
sunrpc/proto.h | 4 +-
sunrpc/rpc_main.c | 4 +-
sunrpc/rpc_scan.h | 7 +-
sunrpc/svc_tcp.c | 2 +-
sunrpc/svc_unix.c | 2 +-
support/check.h | 13 ++-
support/support_test_main.c | 3 +-
sysdeps/arm/unwind.h | 2 +-
sysdeps/generic/exit-thread.h | 2 +-
sysdeps/generic/ldsodefs.h | 17 ++--
sysdeps/htl/pthread.h | 2 +-
sysdeps/htl/pthreadP.h | 2 +-
sysdeps/ia64/jmpbuf-unwind.h | 3 +-
sysdeps/nptl/futex-internal.h | 2 +-
sysdeps/nptl/pthread.h | 6 +-
sysdeps/nptl/threads.h | 2 +-
sysdeps/powerpc/longjmp.c | 6 +-
sysdeps/powerpc/novmxsetjmp.h | 21 ++---
sysdeps/pthread/timer_routines.c | 3 +-
sysdeps/unix/sysv/linux/createthread.c | 4 +-
sysdeps/unix/sysv/linux/exit-thread.h | 2 +-
.../unix/sysv/linux/generic/____longjmp_chk.c | 3 +-
sysdeps/unix/sysv/linux/hppa/pthread.h | 6 +-
sysdeps/unix/sysv/linux/i386/startup.h | 3 +-
.../unix/sysv/linux/ia64/__sigstack_longjmp.c | 4 +-
sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c | 3 +-
sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c | 6 +-
sysdeps/unix/sysv/linux/s390/longjmp_chk.c | 3 +-
sysdeps/x86/longjmp.c | 4 +-
sysdeps/x86/nptl/pt-longjmp.c | 2 +-
81 files changed, 299 insertions(+), 241 deletions(-)
@@ -1,3 +1,95 @@
+2019-02-15 Paul Eggert <eggert@cs.ucla.edu>
+
+ Prefer _Noreturn to __attribute__ ((noreturn))
+ * benchtests/bench-stpcpy_chk.c, benchtests/bench-strcpy_chk.c:
+ * debug/chk_fail.c, debug/test-stpcpy_chk.c:
+ * debug/test-strcpy_chk.c, elf/dl-minimal.c, include/sys/cdefs.h:
+ (__chk_fail):
+ * crypt/cert.c (good_bye):
+ * csu/init-first.c (_dl_start):
+ * csu/libc-start.c (LIBC_START_MAIN):
+ * csu/version.c (__libc_main):
+ * debug/fortify_fail.c (__fortify_fail_abort, __fortify_fail):
+ * debug/stack_chk_fail.c (__stack_chk_fail):
+ * debug/stack_chk_fail_local.c (__stack_chk_fail)
+ (__stack_chk_fail_local):
+ * elf/dl-error-skeleton.c (fatal_error):
+ * elf/dl-exception.c (length_mismatch):
+ * elf/dl-load.c (lose):
+ * elf/dl-tls.c (oom):
+ * elf/nodelete.c (handler):
+ * hurd/hurd.h (_hurd_exit):
+ * include/assert.h (__assert_fail, __asxsert_perror_fail)
+ (__assert_fail_base):
+ * include/setjmp.h (__longjmp, ____longjump_chk)
+ (__libc_siglongjmp, __libc_longjmp):
+ * include/stdio.h (__libc_message):
+ * include/unistd.h (_exit):
+ * locale/programs/localedef.h (show_archive_content):
+ * malloc/dynarray.h (__libc_dynarray_at):
+ * malloc/malloc.c (malloc_printerr):
+ * malloc/mcheck.c (mabort):
+ * malloc/tst-interpose-aux.c (fail):
+ * malloc/tst-mallocfork2.c (signal_sender):
+ * misc/bits/error.h (__error_noreturn, __error_at_line_noreturn):
+ * misc/err.h (err, verr, errx, verrx):
+ * nptl/createthread.c (START_THREAD_DEFN):
+ * nptl/forward.c (__pthread_unwind):
+ * nptl/pt-longjmp.c (longjmp_compat):
+ * nptl/pthreadP.h (__pthread_unwind, __pthread_unwind_next)
+ (__do_cancel, __pthread_exit):
+ * nptl/unwind.c (__pthread_unwind, __pthread_unwind_next):
+ * nptl/version.c (__nptl_main):
+ * nscd/connections.c (nscd_run_prune):
+ * nscd/nscd.c (invalidate_db, send_shutdown):
+ * nscd/nscd.h (termination_handler, start_threads)
+ (receive_print_stats):
+ * posix/unistd.h (_exit):
+ * resolv/gai_misc.c (handle_requests):
+ * setjmp/bits/setjmp2.h (longjmp, _longjmp, siglongjmp, __longjmp_chk):
+ * setjmp/setjmp.h (longjmp, _longjmp, siglongjmp):
+ * setjmp/tst-setjmp.c (jump):
+ * stdlib/exit.h (__run_exit_handlers):
+ * stdlib/stdlib.h (abort, exit, quick_exit, _Exit):
+ * stdlib/tst-random.c (fail):
+ * sunrpc/proto.h (_Noerror, crash):
+ * sunrpc/rpc_main.c (usage, options_usage):
+ * sunrpc/rpc_scan.h (expected1, expected2, expected3):
+ * sunrpc/svc_tcp.c (svctcp_rendezvous_abort):
+ * sunrpc/svc_unix.c (svcunix_rendezvous_abort):
+ * support/check.h (support_exit_failure)
+ (support_test_verify_exit_impl):
+ * support/support_test_main.c (signal_handler):
+ * sysdeps/arm/unwind.h (_Unwind_Resume):
+ * sysdeps/generic/exit-thread.h (__exit_thread):
+ * sysdeps/generic/ldsodefs.h (_dl_signal_exception)
+ (_dl_signal_error, _dl_reloc_bad_type):
+ * sysdeps/htl/pthread.h (pthread_exit):
+ * sysdeps/htl/pthreadP.h (__pthread_exit):
+ * sysdeps/ia64/jmpbuf-unwind.h (__libc_unwind_longjmp):
+ * sysdeps/nptl/futex-internal.h (futex_fatal_error):
+ * sysdeps/nptl/pthread.h (pthread_exit, __pthread_unwind_next):
+ * sysdeps/nptl/threads.h (thrd_exit):
+ * sysdeps/powerpc/longjmp.c (__vmx__longjmp, __vmx__libc_longjmp):
+ * sysdeps/powerpc/novmxsetjmp.h (__novmxlongjmp, __novmx_longjmp)
+ (__novmxsiglongjmp, __novmx__libc_longjmp):
+ * sysdeps/pthread/timer_routines.c (thread_func):
+ * sysdeps/unix/sysv/linux/createthread.c (START_THREAD_DEFN)
+ (start_thread):
+ * sysdeps/unix/sysv/linux/exit-thread.h (__exit_thread):
+ * sysdeps/unix/sysv/linux/generic/____longjmp_chk.c (____longjmp_chk):
+ * sysdeps/unix/sysv/linux/i386/startup.h (_startup_fatal):
+ * sysdeps/unix/sysv/linux/hppa/pthread.h (pthread_exit)
+ (__pthread_unwind_next):
+ * sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c (__ia64_longjmp):
+ * sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c (__sigstack_longjmp):
+ * sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c:
+ (__novmx__libc_siglongjmp, __novmx__libc_longjmp):
+ * sysdeps/unix/sysv/linux/s390/longjmp_chk.c (____longjmp_chk):
+ * sysdeps/x86/longjmp.c (__longjmp_cancel):
+ * sysdeps/x86/nptl/pt-longjmp.c (longjmp_compat):
+ Prefer _Noreturn to __attribute__ ((noreturn)) when either will do.
+
2019-02-15 Adhemerval Zanella <adhemerval.zanella@linaro.org>
* io/Makefile (tests): Add tst-lockf.
@@ -64,20 +64,23 @@
__BEGIN_DECLS
/* This prints an "Assertion failed" message and aborts. */
-extern void __assert_fail (const char *__assertion, const char *__file,
- unsigned int __line, const char *__function)
- __THROW __attribute__ ((__noreturn__));
+extern _Noreturn void __assert_fail (const char *__assertion,
+ const char *__file, unsigned int __line,
+ const char *__function)
+ __THROW;
/* Likewise, but prints the error text for ERRNUM. */
-extern void __assert_perror_fail (int __errnum, const char *__file,
- unsigned int __line, const char *__function)
- __THROW __attribute__ ((__noreturn__));
+extern _Noreturn void __assert_perror_fail (int __errnum, const char *__file,
+ unsigned int __line,
+ const char *__function)
+ __THROW;
/* The following is not at all used here but needed for standard
compliance. */
-extern void __assert (const char *__assertion, const char *__file, int __line)
- __THROW __attribute__ ((__noreturn__));
+extern _Noreturn void __assert (const char *__assertion,
+ const char *__file, int __line)
+ __THROW;
__END_DECLS
@@ -21,7 +21,7 @@
#define TEST_NAME "stpcpy_chk"
#include "bench-string.h"
-extern void __attribute__ ((noreturn)) __chk_fail (void);
+extern _Noreturn void __chk_fail (void);
char *simple_stpcpy_chk (char *, const char *, size_t);
extern char *normal_stpcpy (char *, const char *, size_t)
__asm ("stpcpy");
@@ -25,7 +25,7 @@
/* This test case implicitly tests the availability of the __chk_fail
symbol, which is part of the public ABI and may be used
externally. */
-extern void __attribute__ ((noreturn)) __chk_fail (void);
+extern _Noreturn void __chk_fail (void);
char *simple_strcpy_chk (char *, const char *, size_t);
extern char *normal_strcpy (char *, const char *, size_t)
__asm ("strcpy");
@@ -31,7 +31,7 @@ int totfails = 0;
int main (int argc, char *argv[]);
void get8 (char *cp);
void put8 (char *cp);
-void good_bye (void) __attribute__ ((noreturn));
+_Noreturn void good_bye (void);
void
good_bye (void)
@@ -93,7 +93,7 @@ _init (int argc, char **argv, char **envp)
in ld.so causes disaster, because the _init definition above will
cause ld.so to gain an init function, which is not a cool thing. */
-extern void _dl_start (void) __attribute__ ((noreturn));
+extern _Noreturn void _dl_start (void);
void
_dl_start (void)
@@ -108,18 +108,17 @@ apply_irel (void)
#include <libc-start.h>
-STATIC int LIBC_START_MAIN (int (*main) (int, char **, char **
- MAIN_AUXVEC_DECL),
- int argc,
- char **argv,
+STATIC _Noreturn int LIBC_START_MAIN (int (*main) (int, char **, char **
+ MAIN_AUXVEC_DECL),
+ int argc,
+ char **argv,
#ifdef LIBC_START_MAIN_AUXVEC_ARG
- ElfW(auxv_t) *auxvec,
+ ElfW(auxv_t) *auxvec,
#endif
- __typeof (main) init,
- void (*fini) (void),
- void (*rtld_fini) (void),
- void *stack_end)
- __attribute__ ((noreturn));
+ __typeof (main) init,
+ void (*fini) (void),
+ void (*rtld_fini) (void),
+ void *stack_end);
/* Note: the fini parameter is ignored here for shared library. It
@@ -64,7 +64,7 @@ weak_alias (__gnu_get_libc_version, gnu_get_libc_version)
/* This function is the entry point for the shared object.
Running the library as a program will get here. */
-extern void __libc_main (void) __attribute__ ((noreturn));
+extern _Noreturn void __libc_main (void);
void
__libc_main (void)
{
@@ -21,8 +21,7 @@
extern char **__libc_argv attribute_hidden;
-void
-__attribute__ ((noreturn))
+_Noreturn void
__chk_fail (void)
{
__fortify_fail ("buffer overflow detected");
@@ -22,8 +22,7 @@
extern char **__libc_argv attribute_hidden;
-void
-__attribute__ ((noreturn))
+_Noreturn void
__fortify_fail_abort (_Bool need_backtrace, const char *msg)
{
/* The loop is added only to keep gcc happy. Don't pass down
@@ -37,8 +36,7 @@ __fortify_fail_abort (_Bool need_backtrace, const char *msg)
? __libc_argv[0] : "<unknown>"));
}
-void
-__attribute__ ((noreturn))
+_Noreturn void
__fortify_fail (const char *msg)
{
__fortify_fail_abort (true, msg);
@@ -22,8 +22,7 @@
extern char **__libc_argv attribute_hidden;
-void
-__attribute__ ((noreturn))
+_Noreturn void
__stack_chk_fail (void)
{
__fortify_fail_abort (false, "stack smashing detected");
@@ -34,12 +34,12 @@
#include <sys/cdefs.h>
-extern void __stack_chk_fail (void) __attribute__ ((noreturn));
+extern _Noreturn void __stack_chk_fail (void);
/* On some architectures, this helps needless PIC pointer setup
that would be needed just for the __stack_chk_fail call. */
-void __attribute__ ((noreturn)) attribute_hidden
+_Noreturn void attribute_hidden
__stack_chk_fail_local (void)
{
__stack_chk_fail ();
@@ -22,7 +22,7 @@
#define TEST_NAME "stpcpy_chk"
#include "../string/test-string.h"
-extern void __attribute__ ((noreturn)) __chk_fail (void);
+extern _Noreturn void __chk_fail (void);
char *simple_stpcpy_chk (char *, const char *, size_t);
extern char *normal_stpcpy (char *, const char *, size_t)
__asm ("stpcpy");
@@ -26,7 +26,7 @@
/* This test case implicitly tests the availability of the __chk_fail
symbol, which is part of the public ABI and may be used
externally. */
-extern void __attribute__ ((noreturn)) __chk_fail (void);
+extern _Noreturn void __chk_fail (void);
char *simple_strcpy_chk (char *, const char *, size_t);
extern char *normal_strcpy (char *, const char *, size_t)
__asm ("strcpy");
@@ -69,8 +69,7 @@ static receiver_fct receiver;
#endif /* DL_ERROR_BOOTSTRAP */
/* Lossage while resolving the program's own symbols is always fatal. */
-static void
-__attribute__ ((noreturn))
+static _Noreturn void
fatal_error (int errcode, const char *objname, const char *occasion,
const char *errstring)
{
@@ -40,8 +40,7 @@ oom_exception (struct dl_exception *exception)
exception->message_buffer = NULL;
}
-static void
-__attribute__ ((noreturn))
+static _Noreturn void
length_mismatch (void)
{
_dl_fatal_printf ("Fatal error: "
@@ -828,8 +828,7 @@ _dl_init_paths (const char *llp)
}
-static void
-__attribute__ ((noreturn, noinline))
+static _Noreturn void
lose (int code, int fd, const char *name, char *realname, struct link_map *l,
const char *msg, struct r_debug *r, Lmid_t nsid)
{
@@ -190,8 +190,7 @@ __libc_fatal (const char *message)
}
rtld_hidden_def (__libc_fatal)
-void
-__attribute__ ((noreturn))
+_Noreturn void
__chk_fail (void)
{
_exit (127);
@@ -35,8 +35,7 @@
/* Out-of-memory handler. */
-static void
-__attribute__ ((__noreturn__))
+static _Noreturn void
oom (void)
{
_dl_fatal_printf ("cannot allocate memory for thread-local data: ABORT\n");
@@ -10,8 +10,7 @@ static sigjmp_buf jmpbuf;
int fini_ran;
-static void
-__attribute__ ((noreturn))
+static _Noreturn void
handler (int sig)
{
siglongjmp (jmpbuf, 1);
@@ -266,7 +266,7 @@ extern error_t _hurd_exec_paths (task_t task,
/* Inform the proc server we have exited with STATUS, and kill the
task thoroughly. This function never returns, no matter what. */
-extern void _hurd_exit (int status) __attribute__ ((noreturn));
+extern _Noreturn void _hurd_exit (int status);
/* Initialize the library data structures from the
@@ -4,21 +4,23 @@
/* This prints an "Assertion failed" message and aborts.
In installed assert.h this is only conditionally declared,
so it has to be repeated here. */
-extern void __assert_fail (const char *__assertion, const char *__file,
- unsigned int __line, const char *__function)
- __THROW __attribute__ ((__noreturn__));
+extern _Noreturn void __assert_fail (const char *__assertion,
+ const char *__file, unsigned int __line,
+ const char *__function)
+ __THROW;
/* Likewise, but prints the error text for ERRNUM. */
-extern void __assert_perror_fail (int __errnum, const char *__file,
- unsigned int __line,
- const char *__function)
- __THROW __attribute__ ((__noreturn__));
+extern _Noreturn void __assert_perror_fail (int __errnum, const char *__file,
+ unsigned int __line,
+ const char *__function)
+ __THROW;
/* The real implementation of the two functions above. */
-extern void __assert_fail_base (const char *fmt, const char *assertion,
- const char *file, unsigned int line,
- const char *function)
- __THROW __attribute__ ((__noreturn__)) attribute_hidden;
+extern _Noreturn void __assert_fail_base (const char *fmt,
+ const char *assertion,
+ const char *file, unsigned int line,
+ const char *function)
+ __THROW;
# if IS_IN (libc) || (IS_IN (rtld) && !defined NO_RTLD_HIDDEN)
hidden_proto (__assert_fail)
@@ -5,11 +5,11 @@
/* Now define the internal interfaces. */
/* Internal machine-dependent function to restore context sans signal mask. */
-extern void __longjmp (__jmp_buf __env, int __val)
- __attribute__ ((__noreturn__)) attribute_hidden;
+extern _Noreturn void __longjmp (__jmp_buf __env, int __val)
+ attribute_hidden;
-extern void ____longjmp_chk (__jmp_buf __env, int __val)
- __attribute__ ((__noreturn__)) attribute_hidden;
+extern _Noreturn void ____longjmp_chk (__jmp_buf __env, int __val)
+ attribute_hidden;
/* Internal function to possibly save the current mask of blocked signals
in ENV, and always set the flag saying whether or not it was saved.
@@ -19,10 +19,8 @@ extern int __sigjmp_save (jmp_buf __env, int __savemask);
extern void _longjmp_unwind (jmp_buf env, int val);
-extern void __libc_siglongjmp (sigjmp_buf env, int val)
- __attribute__ ((noreturn));
-extern void __libc_longjmp (sigjmp_buf env, int val)
- __attribute__ ((noreturn));
+extern _Noreturn void __libc_siglongjmp (sigjmp_buf env, int val);
+extern _Noreturn void __libc_longjmp (sigjmp_buf env, int val);
libc_hidden_proto (_setjmp)
libc_hidden_proto (__sigsetjmp)
@@ -107,13 +107,12 @@ enum __libc_message_action
/* Print out MESSAGE (which should end with a newline) on the error output
and abort. */
-extern void __libc_fatal (const char *__message)
- __attribute__ ((__noreturn__));
+extern _Noreturn void __libc_fatal (const char *__message);
extern void __libc_message (enum __libc_message_action action,
const char *__fnt, ...) attribute_hidden;
-extern void __fortify_fail (const char *msg) __attribute__ ((__noreturn__));
-extern void __fortify_fail_abort (_Bool, const char *msg)
- __attribute__ ((__noreturn__)) attribute_hidden;
+extern _Noreturn void __fortify_fail (const char *msg);
+extern _Noreturn void __fortify_fail_abort (_Bool, const char *msg)
+ attribute_hidden;
libc_hidden_proto (__fortify_fail)
libc_hidden_proto (__fortify_fail_abort)
@@ -9,7 +9,7 @@
# undef __nonnull
# define __nonnull(params)
-extern void __chk_fail (void) __attribute__ ((__noreturn__));
+extern _Noreturn void __chk_fail (void);
libc_hidden_proto (__chk_fail)
rtld_hidden_proto (__chk_fail)
@@ -3,8 +3,8 @@
# ifndef _ISOMAC
-libc_hidden_proto (_exit, __noreturn__)
-rtld_hidden_proto (_exit, __noreturn__)
+libc_hidden_proto (_exit);
+rtld_hidden_proto (_exit);
libc_hidden_proto (alarm)
extern size_t __confstr (int name, char *buf, size_t len);
libc_hidden_proto (__confstr)
@@ -161,7 +161,7 @@ extern int delete_locales_from_archive (size_t nlist, char *list[]);
/* List content of locale archive. If FNAME is non-null use that as
the locale archive to list, otherwise the default. */
-extern void show_archive_content (const char *fname,
- int verbose) __attribute__ ((noreturn));
+extern _Noreturn void show_archive_content (const char *fname,
+ int verbose);
#endif /* localedef.h */
@@ -165,8 +165,7 @@ bool __libc_dynarray_finalize (struct dynarray_header *list, void *scratch,
/* Internal function. Terminate the process after an index error.
SIZE is the number of elements of the dynamic array. INDEX is the
lookup index which triggered the failure. */
-void __libc_dynarray_at_failure (size_t size, size_t index)
- __attribute__ ((noreturn));
+_Noreturn void __libc_dynarray_at_failure (size_t size, size_t index);
#ifndef _ISOMAC
libc_hidden_proto (__libc_dynarray_emplace_enlarge)
@@ -996,7 +996,7 @@ static void* _int_realloc(mstate, mchunkptr, INTERNAL_SIZE_T,
static void* _int_memalign(mstate, size_t, size_t);
static void* _mid_memalign(size_t, size_t, void *);
-static void malloc_printerr(const char *str) __attribute__ ((noreturn));
+static _Noreturn void malloc_printerr (const char *str);
static void* mem2mem_check(void *p, size_t sz);
static void top_check(void);
@@ -333,8 +333,7 @@ reallochook (void *ptr, size_t size, const void *caller)
return (void *) (hdr + 1);
}
-__attribute__ ((noreturn))
-static void
+static _Noreturn void
mabort (enum mcheck_status status)
{
const char *msg;
@@ -34,9 +34,8 @@
#endif
/* Print the error message and terminate the process with status 1. */
-__attribute__ ((noreturn))
__attribute__ ((format (printf, 1, 2)))
-static void *
+static _Noreturn void *
fail (const char *format, ...)
{
/* This assumes that vsnprintf will not call malloc. It does not do
@@ -108,8 +108,7 @@ liveness_signal_handler (int signo)
write_message ("warning: process seems to be stuck\n");
}
-static void
-__attribute__ ((noreturn))
+static _Noreturn void
signal_sender (int signo, bool sleep)
{
pid_t target = getppid ();
@@ -25,10 +25,10 @@ extern void __REDIRECT (__error_alias, (int __status, int __errnum,
const char *__format, ...),
error)
__attribute__ ((__format__ (__printf__, 3, 4)));
-extern void __REDIRECT (__error_noreturn, (int __status, int __errnum,
- const char *__format, ...),
- error)
- __attribute__ ((__noreturn__, __format__ (__printf__, 3, 4)));
+extern _Noreturn void __REDIRECT (__error_noreturn, (int __status, int __errnum,
+ const char *__format, ...),
+ error)
+ __attribute__ ((__format__ (__printf__, 3, 4)));
/* If we know the function will never return make sure the compiler
@@ -49,13 +49,12 @@ extern void __REDIRECT (__error_at_line_alias, (int __status, int __errnum,
const char *__format, ...),
error_at_line)
__attribute__ ((__format__ (__printf__, 5, 6)));
-extern void __REDIRECT (__error_at_line_noreturn, (int __status, int __errnum,
- const char *__fname,
- unsigned int __line,
- const char *__format,
- ...),
+extern _Noreturn void __REDIRECT (__error_at_line_noreturn,
+ (int __status, int __errnum,
+ const char *__fname, unsigned int __line,
+ const char *__format, ...),
error_at_line)
- __attribute__ ((__noreturn__, __format__ (__printf__, 5, 6)));
+ __attribute__ ((__format__ (__printf__, 5, 6)));
/* If we know the function will never return make sure the compiler
@@ -43,14 +43,14 @@ extern void vwarnx (const char *__format, __gnuc_va_list)
__attribute__ ((__format__ (__printf__, 1, 0)));
/* Likewise, and then exit with STATUS. */
-extern void err (int __status, const char *__format, ...)
- __attribute__ ((__noreturn__, __format__ (__printf__, 2, 3)));
-extern void verr (int __status, const char *__format, __gnuc_va_list)
- __attribute__ ((__noreturn__, __format__ (__printf__, 2, 0)));
-extern void errx (int __status, const char *__format, ...)
- __attribute__ ((__noreturn__, __format__ (__printf__, 2, 3)));
-extern void verrx (int __status, const char *, __gnuc_va_list)
- __attribute__ ((__noreturn__, __format__ (__printf__, 2, 0)));
+extern _Noreturn void err (int __status, const char *__format, ...)
+ __attribute__ ((__format__ (__printf__, 2, 3)));
+extern _Noreturn void verr (int __status, const char *__format, __gnuc_va_list)
+ __attribute__ ((__format__ (__printf__, 2, 0)));
+extern _Noreturn void errx (int __status, const char *__format, ...)
+ __attribute__ ((__format__ (__printf__, 2, 3)));
+extern _Noreturn void verrx (int __status, const char *, __gnuc_va_list)
+ __attribute__ ((__format__ (__printf__, 2, 0)));
__END_DECLS
@@ -20,7 +20,7 @@
two macros and the create_thread function. */
#define START_THREAD_DEFN \
- static void __attribute__ ((noreturn)) start_thread (void)
+ static _Noreturn void start_thread (void)
#define START_THREAD_SELF THREAD_SELF
static int
@@ -200,7 +200,7 @@ strong_alias (__pthread_setcancelstate, pthread_setcancelstate)
FORWARD (pthread_setcanceltype, (int type, int *oldtype), (type, oldtype), 0)
FORWARD_NORETURN (__pthread_unwind,
- void attribute_hidden __attribute ((noreturn))
+ _Noreturn void attribute_hidden
__cleanup_fct_attribute attribute_compat_text_section,
(__pthread_unwind_buf_t *buf), (buf),
__safe_fatal ())
@@ -34,7 +34,7 @@
#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_22)
-static void __attribute__ ((noreturn, used))
+static _Noreturn void __attribute__ ((used))
longjmp_compat (jmp_buf env, int val)
{
__libc_longjmp (env, val);
@@ -268,14 +268,14 @@ extern int __pthread_debug attribute_hidden;
} while (0)
-extern void __pthread_unwind (__pthread_unwind_buf_t *__buf)
- __cleanup_fct_attribute __attribute ((__noreturn__))
+extern _Noreturn void __pthread_unwind (__pthread_unwind_buf_t *__buf)
+ __cleanup_fct_attribute
#if !defined SHARED && !IS_IN (libpthread)
weak_function
#endif
;
-extern void __pthread_unwind_next (__pthread_unwind_buf_t *__buf)
- __cleanup_fct_attribute __attribute ((__noreturn__))
+extern _Noreturn void __pthread_unwind_next (__pthread_unwind_buf_t *__buf)
+ __cleanup_fct_attribute
#ifndef SHARED
weak_function
#endif
@@ -297,8 +297,8 @@ extern void __nptl_unwind_freeres (void) attribute_hidden;
/* Called when a thread reacts on a cancellation request. */
-static inline void
-__attribute ((noreturn, always_inline))
+static inline _Noreturn void
+__attribute ((always_inline))
__do_cancel (void)
{
struct pthread *self = THREAD_SELF;
@@ -502,7 +502,7 @@ extern int __pthread_equal (pthread_t thread1, pthread_t thread2);
extern int __pthread_detach (pthread_t th);
extern int __pthread_cancel (pthread_t th);
extern int __pthread_kill (pthread_t threadid, int signo);
-extern void __pthread_exit (void *value) __attribute__ ((__noreturn__));
+extern _Noreturn void __pthread_exit (void *value);
extern int __pthread_join (pthread_t threadid, void **thread_return);
extern int __pthread_setcanceltype (int type, int *oldtype);
extern int __pthread_enable_asynccancel (void) attribute_hidden;
@@ -106,8 +106,8 @@ unwind_cleanup (_Unwind_Reason_Code reason, struct _Unwind_Exception *exc)
}
-void
-__cleanup_fct_attribute __attribute ((noreturn))
+_Noreturn void
+__cleanup_fct_attribute
__pthread_unwind (__pthread_unwind_buf_t *buf)
{
struct pthread_unwind_buf *ibuf = (struct pthread_unwind_buf *) buf;
@@ -127,8 +127,8 @@ __pthread_unwind (__pthread_unwind_buf_t *buf)
hidden_def (__pthread_unwind)
-void
-__cleanup_fct_attribute __attribute ((noreturn))
+_Noreturn void
+__cleanup_fct_attribute
__pthread_unwind_next (__pthread_unwind_buf_t *buf)
{
struct pthread_unwind_buf *ibuf = (struct pthread_unwind_buf *) buf;
@@ -32,8 +32,7 @@ PARTICULAR PURPOSE.\n"
/* This is made the e_entry of libpthread.so by LDFLAGS-pthread.so. */
-__attribute__ ((noreturn))
-void
+_Noreturn void
__nptl_main (void)
{
__libc_write (STDOUT_FILENO, banner, sizeof banner - 1);
@@ -1491,8 +1491,7 @@ static unsigned long int nready;
/* Function for the clean-up threads. */
-static void *
-__attribute__ ((__noreturn__))
+static _Noreturn void *
nscd_run_prune (void *p)
{
const long int my_number = (long int) p;
@@ -1591,8 +1590,7 @@ nscd_run_prune (void *p)
/* This is the main loop. It is replicated in different threads but
the use of the ready list makes sure only one thread handles an
incoming connection. */
-static void *
-__attribute__ ((__noreturn__))
+static _Noreturn void *
nscd_run_worker (void *p)
{
char buf[256];
@@ -2009,8 +2007,7 @@ handle_inotify_events (void)
#endif
-static void
-__attribute__ ((__noreturn__))
+static _Noreturn void
main_loop_poll (void)
{
struct pollfd *conns = (struct pollfd *) xmalloc (nconns
@@ -324,7 +324,7 @@ main (int argc, char **argv)
}
-static void __attribute__ ((noreturn))
+static _Noreturn void
invalidate_db (const char *dbname)
{
int sock = nscd_open_socket ();
@@ -374,7 +374,7 @@ invalidate_db (const char *dbname)
exit (0);
}
-static void __attribute__ ((noreturn))
+static _Noreturn void
send_shutdown (void)
{
int sock = nscd_open_socket ();
@@ -252,7 +252,7 @@ extern gid_t old_gid;
#include <programs/xmalloc.h>
/* nscd.c */
-extern void termination_handler (int signum) __attribute__ ((__noreturn__));
+extern _Noreturn void termination_handler (int signum);
extern int nscd_open_socket (void);
void notify_parent (int child_ret);
void do_exit (int child_ret, int errnum, const char *format, ...);
@@ -264,7 +264,7 @@ extern void register_traced_file (size_t dbidx, struct traced_file *finfo);
extern void install_watches (struct traced_file *finfo);
#endif
extern void close_sockets (void);
-extern void start_threads (void) __attribute__ ((__noreturn__));
+extern _Noreturn void start_threads (void);
/* nscd_conf.c */
extern int nscd_parse_file (const char *fname,
@@ -272,7 +272,7 @@ extern int nscd_parse_file (const char *fname,
/* nscd_stat.c */
extern void send_stats (int fd, struct database_dyn dbs[lastdb]);
-extern int receive_print_stats (void) __attribute__ ((__noreturn__));
+extern _Noreturn int receive_print_stats (void);
/* cache.c */
extern struct datahead *cache_search (request_type, const void *key,
@@ -600,7 +600,7 @@ extern int nice (int __inc) __THROW __wur;
/* Terminate program execution with the low-order 8 bits of STATUS. */
-extern void _exit (int __status) __attribute__ ((__noreturn__));
+extern _Noreturn void _exit (int __status);
/* Get the `_PC_*' symbols for the NAME argument to `pathconf' and `fpathconf';
@@ -295,8 +295,7 @@ __gai_enqueue_request (struct gaicb *gaicbp)
}
-static void *
-__attribute__ ((noreturn))
+static _Noreturn void *
handle_requests (void *arg)
{
struct requestlist *runp = (struct requestlist *) arg;
@@ -22,18 +22,21 @@
/* Variant of the longjmp functions which perform some sanity checking. */
#ifdef __REDIRECT_NTH
-extern void __REDIRECT_NTHNL (longjmp,
- (struct __jmp_buf_tag __env[1], int __val),
- __longjmp_chk) __attribute__ ((__noreturn__));
-extern void __REDIRECT_NTHNL (_longjmp,
- (struct __jmp_buf_tag __env[1], int __val),
- __longjmp_chk) __attribute__ ((__noreturn__));
-extern void __REDIRECT_NTHNL (siglongjmp,
- (struct __jmp_buf_tag __env[1], int __val),
- __longjmp_chk) __attribute__ ((__noreturn__));
+extern _Noreturn void __REDIRECT_NTHNL (longjmp,
+ (struct __jmp_buf_tag __env[1],
+ int __val),
+ __longjmp_chk);
+extern _Noreturn void __REDIRECT_NTHNL (_longjmp,
+ (struct __jmp_buf_tag __env[1],
+ int __val),
+ __longjmp_chk);
+extern _Noreturn void __REDIRECT_NTHNL (siglongjmp,
+ (struct __jmp_buf_tag __env[1],
+ int __val),
+ __longjmp_chk);
#else
-extern void __longjmp_chk (struct __jmp_buf_tag __env[1], int __val),
- __THROWNL __attribute__ ((__noreturn__));
+extern _Noreturn void __longjmp_chk (struct __jmp_buf_tag __env[1], int __val),
+ __THROWNL;
# define longjmp __longjmp_chk
# define _longjmp __longjmp_chk
# define siglongjmp __longjmp_chk
@@ -64,15 +64,15 @@ extern int _setjmp (struct __jmp_buf_tag __env[1]) __THROWNL;
/* Jump to the environment saved in ENV, making the
`setjmp' call there return VAL, or 1 if VAL is 0. */
-extern void longjmp (struct __jmp_buf_tag __env[1], int __val)
- __THROWNL __attribute__ ((__noreturn__));
+extern _Noreturn void longjmp (struct __jmp_buf_tag __env[1], int __val)
+ __THROWNL;
#if defined __USE_MISC || defined __USE_XOPEN
/* Same. Usually `_longjmp' is used with `_setjmp', which does not save
the signal mask. But it is how ENV was saved that determines whether
`longjmp' restores the mask; `_longjmp' is just an alias. */
-extern void _longjmp (struct __jmp_buf_tag __env[1], int __val)
- __THROWNL __attribute__ ((__noreturn__));
+extern _Noreturn void _longjmp (struct __jmp_buf_tag __env[1], int __val)
+ __THROWNL;
#endif
@@ -90,8 +90,7 @@ typedef struct __jmp_buf_tag sigjmp_buf[1];
sigsetjmp call there return VAL, or 1 if VAL is 0.
Restore the signal mask if that sigsetjmp call saved it.
This is just an alias `longjmp'. */
-extern void siglongjmp (sigjmp_buf __env, int __val)
- __THROWNL __attribute__ ((__noreturn__));
+extern _Noreturn void siglongjmp (sigjmp_buf __env, int __val) __THROWNL;
#endif /* Use POSIX. */
@@ -22,7 +22,7 @@
static jmp_buf env;
static int last_value = -1, lose = 0;
-static __attribute__ ((__noreturn__)) void
+static _Noreturn void
jump (int val)
{
longjmp (env, val);
@@ -80,10 +80,10 @@ __libc_lock_define (extern, __exit_funcs_lock);
extern struct exit_function *__new_exitfn (struct exit_function_list **listp)
attribute_hidden;
-extern void __run_exit_handlers (int status,
- struct exit_function_list **listp,
- bool run_list_atexit, bool run_dtors)
- attribute_hidden __attribute__ ((__noreturn__));
+extern _Noreturn void __run_exit_handlers (int status,
+ struct exit_function_list **listp,
+ bool run_list_atexit, bool run_dtors)
+ attribute_hidden;
extern int __internal_atexit (void (*func) (void *), void *arg, void *d,
struct exit_function_list **listp)
@@ -585,7 +585,7 @@ extern void *aligned_alloc (size_t __alignment, size_t __size)
#endif
/* Abort execution and generate a core-dump. */
-extern void abort (void) __THROW __attribute__ ((__noreturn__));
+extern _Noreturn void abort (void) __THROW;
/* Register a function to be called when `exit' is called. */
@@ -611,19 +611,19 @@ extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
/* Call all functions registered with `atexit' and `on_exit',
in the reverse of the order in which they were registered,
perform stdio cleanup, and terminate program execution with STATUS. */
-extern void exit (int __status) __THROW __attribute__ ((__noreturn__));
+extern _Noreturn void exit (int __status) __THROW;
#if defined __USE_ISOC11 || defined __USE_ISOCXX11
/* Call all functions registered with `at_quick_exit' in the reverse
of the order in which they were registered and terminate program
execution with STATUS. */
-extern void quick_exit (int __status) __THROW __attribute__ ((__noreturn__));
+extern _Noreturn void quick_exit (int __status) __THROW;
#endif
#ifdef __USE_ISOC99
/* Terminate the program with STATUS without calling any of the
functions registered with `atexit' or `on_exit'. */
-extern void _Exit (int __status) __THROW __attribute__ ((__noreturn__));
+extern _Noreturn void _Exit (int __status) __THROW;
#endif
@@ -44,7 +44,7 @@ const int nseq = 3; /* number of test sequences */
const int nrnd = 50; /* length of each test sequence */
const unsigned int seed[3] = { 0x12344321U, 0xEE11DD22U, 0xFEDCBA98 };
-void fail (const char *msg, int s, int i) __attribute__ ((__noreturn__));
+void _Noreturn fail (const char *msg, int s, int i);
static int
do_test (void)
@@ -45,8 +45,8 @@ void write_tables(void);
/****** rpc_util.c ******/
void reinitialize(void);
int streq(const char *a, const char *b);
-void error(const char *msg) __attribute__ ((noreturn));
-void crash(void) __attribute__ ((noreturn));
+_Noreturn void _Noerror (const char *msg);
+_Noreturn void crash (void);
void tabify(FILE *f, int tab);
char *make_argname(const char *pname, const char *vname);
void add_type(int len, const char *type);
@@ -131,8 +131,8 @@ static void addarg (const char *cp);
static void putarg (int whereto, const char *cp);
static void checkfiles (const char *infile, const char *outfile);
static int parseargs (int argc, const char *argv[], struct commandline *cmd);
-static void usage (FILE *stream, int status) __attribute__ ((noreturn));
-static void options_usage (FILE *stream, int status) __attribute__ ((noreturn));
+static _Noreturn void usage (FILE *stream, int status);
+static _Noreturn void options_usage (FILE *stream, int status);
static void print_version (void);
static void c_initialize (void);
static char *generate_guard (const char *pathname);
@@ -98,7 +98,6 @@ void scan_num(token *tokp);
void peek(token *tokp);
int peekscan(tok_kind expect, token *tokp);
void get_token(token *tokp);
-void expected1(tok_kind exp1) __attribute__ ((noreturn));
-void expected2(tok_kind exp1, tok_kind exp2) __attribute__ ((noreturn));
-void expected3(tok_kind exp1, tok_kind exp2, tok_kind exp3)
- __attribute__ ((noreturn));
+_Noreturn void expected1 (tok_kind exp1);
+_Noreturn void expected2 (tok_kind exp1, tok_kind exp2);
+_Noreturn void expected3 (tok_kind exp1, tok_kind exp2, tok_kind exp3);
@@ -91,7 +91,7 @@ static const struct xp_ops svctcp_op =
*/
static bool_t rendezvous_request (SVCXPRT *, struct rpc_msg *);
static enum xprt_stat rendezvous_stat (SVCXPRT *);
-static void svctcp_rendezvous_abort (void) __attribute__ ((__noreturn__));
+static _Noreturn void svctcp_rendezvous_abort (void);
/* This function makes sure abort() relocation goes through PLT
and thus can be lazy bound. */
@@ -91,7 +91,7 @@ static const struct xp_ops svcunix_op =
*/
static bool_t rendezvous_request (SVCXPRT *, struct rpc_msg *);
static enum xprt_stat rendezvous_stat (SVCXPRT *);
-static void svcunix_rendezvous_abort (void) __attribute__ ((__noreturn__));
+static _Noreturn void svcunix_rendezvous_abort (void);
/* This function makes sure abort() relocation goes through PLT
and thus can be lazy bound. */
@@ -69,15 +69,14 @@ __BEGIN_DECLS
int support_print_failure_impl (const char *file, int line,
const char *format, ...)
__attribute__ ((nonnull (1), format (printf, 3, 4)));
-void support_exit_failure_impl (int exit_status,
- const char *file, int line,
- const char *format, ...)
- __attribute__ ((noreturn, nonnull (2), format (printf, 4, 5)));
+_Noreturn void support_exit_failure_impl (int exit_status,
+ const char *file, int line,
+ const char *format, ...)
+ __attribute__ ((nonnull (2), format (printf, 4, 5)));
void support_test_verify_impl (const char *file, int line,
const char *expr);
-void support_test_verify_exit_impl (int status, const char *file, int line,
- const char *expr)
- __attribute__ ((noreturn));
+_Noreturn void support_test_verify_exit_impl (int status, const char *file,
+ int line, const char *expr);
/* Record a test failure. This function returns and does not
terminate the process. The failure counter is stored in a shared
@@ -101,8 +101,7 @@ print_timestamp (const char *what, struct timeval tv)
}
/* Timeout handler. We kill the child and exit with an error. */
-static void
-__attribute__ ((noreturn))
+static _Noreturn void
signal_handler (int sig)
{
int killed;
@@ -202,7 +202,7 @@ extern "C" {
/* Interface functions: */
_Unwind_Reason_Code _Unwind_RaiseException(_Unwind_Control_Block *ucbp);
- void __attribute__((noreturn)) _Unwind_Resume(_Unwind_Control_Block *ucbp);
+ _Noreturn void _Unwind_Resume (_Unwind_Control_Block *ucbp);
_Unwind_Reason_Code _Unwind_Resume_or_Rethrow (_Unwind_Control_Block *ucbp);
typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn)
@@ -20,7 +20,7 @@
threads in the process if there are any. If there are no other
threads left, then this has the effect of _exit (0). */
-static inline void __attribute__ ((noreturn, always_inline, unused))
+static inline _Noreturn void __attribute__ ((always_inline, unused))
__exit_thread (void)
{
while (1)
@@ -786,15 +786,14 @@ rtld_hidden_proto (_dl_exception_free)
`errno' code or zero; it specifies the return value of
_dl_catch_error. OCCASION is included in the error message if the
process is terminated immediately. */
-void _dl_signal_exception (int errcode, struct dl_exception *,
- const char *occasion)
- __attribute__ ((__noreturn__));
+_Noreturn void _dl_signal_exception (int errcode, struct dl_exception *,
+ const char *occasion);
libc_hidden_proto (_dl_signal_exception)
/* Like _dl_signal_exception, but creates the exception first. */
-extern void _dl_signal_error (int errcode, const char *object,
- const char *occasion, const char *errstring)
- __attribute__ ((__noreturn__));
+extern _Noreturn void _dl_signal_error (int errcode, const char *object,
+ const char *occasion,
+ const char *errstring);
libc_hidden_proto (_dl_signal_error)
/* Like _dl_signal_exception, but may return when called in the
@@ -943,9 +942,9 @@ extern void _dl_protect_relro (struct link_map *map) attribute_hidden;
/* Call _dl_signal_error with a message about an unhandled reloc type.
TYPE is the result of ELFW(R_TYPE) (r_info), i.e. an R_<CPU>_* value.
PLT is nonzero if this was a PLT reloc; it just affects the message. */
-extern void _dl_reloc_bad_type (struct link_map *map,
- unsigned int type, int plt)
- attribute_hidden __attribute__ ((__noreturn__));
+extern _Noreturn void _dl_reloc_bad_type (struct link_map *map,
+ unsigned int type, int plt)
+ attribute_hidden;
/* Resolve conflicts if prelinking. */
extern void _dl_resolve_conflicts (struct link_map *l,
@@ -216,7 +216,7 @@ extern int pthread_create (pthread_t *__restrict __threadp,
/* Terminate the current thread and make STATUS available to any
thread that might join us. */
-extern void pthread_exit (void *__status) __attribute__ ((__noreturn__));
+extern _Noreturn void pthread_exit (void *__status);
/* Make calling thread wait for termination of thread THREAD. Return
the exit status of the thread in *STATUS. */
@@ -44,7 +44,7 @@ int __pthread_create (pthread_t *newthread,
void __cthread_detach (__cthread_t);
int __pthread_detach (pthread_t __threadp);
-void __pthread_exit (void *value) __attribute__ ((__noreturn__));
+_Noreturn void __pthread_exit (void *value);
int __cthread_keycreate (__cthread_key_t *);
int __cthread_getspecific (__cthread_key_t, void **);
int __cthread_setspecific (__cthread_key_t, void *);
@@ -38,6 +38,5 @@
/* We use a longjmp() which can cross from the alternate signal-stack
to the normal stack. */
-extern void __libc_unwind_longjmp (sigjmp_buf env, int val)
- __attribute__ ((noreturn));
+extern _Noreturn void __libc_unwind_longjmp (sigjmp_buf env, int val);
hidden_proto (__libc_unwind_longjmp)
@@ -194,7 +194,7 @@ futex_wake (unsigned int* futex_word, int processes_to_wake, int private);
/* Calls __libc_fatal with an error message. Convenience function for
concrete implementations of the futex interface. */
-static __always_inline __attribute__ ((__noreturn__)) void
+static __always_inline _Noreturn void
futex_fatal_error (void)
{
__libc_fatal ("The futex facility returned an unexpected error code.\n");
@@ -240,7 +240,7 @@ extern int pthread_create (pthread_t *__restrict __newthread,
The registered cleanup handlers are called via exception handling
so we cannot mark this function with __THROW.*/
-extern void pthread_exit (void *__retval) __attribute__ ((__noreturn__));
+extern _Noreturn void pthread_exit (void *__retval);
/* Make calling thread wait for termination of the thread TH. The
exit status of the thread is stored in *THREAD_RETURN, if THREAD_RETURN
@@ -731,8 +731,8 @@ extern void __pthread_unregister_cancel_restore (__pthread_unwind_buf_t *__buf)
# endif
/* Internal interface to initiate cleanup. */
-extern void __pthread_unwind_next (__pthread_unwind_buf_t *__buf)
- __cleanup_fct_attribute __attribute__ ((__noreturn__))
+extern _Noreturn void __pthread_unwind_next (__pthread_unwind_buf_t *__buf)
+ __cleanup_fct_attribute
# ifndef SHARED
__attribute__ ((__weak__))
# endif
@@ -96,7 +96,7 @@ extern int thrd_sleep (const struct timespec *__time_point,
/* Terminate current thread execution, cleaning up any thread local
storage and freeing resources. Returns the value specified in __RES. */
-extern void thrd_exit (int __res) __attribute__ ((__noreturn__));
+extern _Noreturn void thrd_exit (int __res);
/* Detach the thread identified by __THR from the current environment
(it does not allow join or wait for it). */
@@ -22,10 +22,8 @@
#include <setjmp.h>
#include <signal.h>
-extern void __vmx__longjmp (__jmp_buf __env, int __val)
- __attribute__ ((noreturn));
-extern void __vmx__libc_longjmp (sigjmp_buf env, int val)
- __attribute__ ((noreturn));
+extern _Noreturn void __vmx__longjmp (__jmp_buf __env, int __val);
+extern _Noreturn void __vmx__libc_longjmp (sigjmp_buf env, int val);
libc_hidden_proto (__vmx__libc_longjmp)
/* Set the signal mask to the one specified in ENV, and jump
@@ -85,14 +85,14 @@ extern int __novmx_setjmp (struct __novmx__jmp_buf_tag __env[1]);
/* Jump to the environment saved in ENV, making the
`setjmp' call there return VAL, or 1 if VAL is 0. */
-extern void __novmxlongjmp (struct __novmx__jmp_buf_tag __env[1], int __val)
- __attribute__ ((__noreturn__));
+extern _Noreturn void __novmxlongjmp (struct __novmx__jmp_buf_tag __env[1],
+ int __val);
/* Same. Usually `_longjmp' is used with `_setjmp', which does not save
the signal mask. But it is how ENV was saved that determines whether
`longjmp' restores the mask; `_longjmp' is just an alias. */
-extern void __novmx_longjmp (struct __novmx__jmp_buf_tag __env[1], int __val)
- __attribute__ ((__noreturn__));
+extern _Noreturn void __novmx_longjmp (struct __novmx__jmp_buf_tag __env[1],
+ int __val);
/* Use the same type for `jmp_buf' and `sigjmp_buf'.
The `__mask_was_saved' flag determines whether
@@ -103,12 +103,10 @@ typedef struct __novmx__jmp_buf_tag __novmx__sigjmp_buf[1];
sigsetjmp call there return VAL, or 1 if VAL is 0.
Restore the signal mask if that sigsetjmp call saved it.
This is just an alias `longjmp'. */
-extern void __novmxsiglongjmp (__novmx__sigjmp_buf __env, int __val)
- __attribute__ ((__noreturn__));
+extern _Noreturn void __novmxsiglongjmp (__novmx__sigjmp_buf __env, int __val);
/* Internal machine-dependent function to restore context sans signal mask. */
-extern void __novmx__longjmp (__jmp_buf __env, int __val)
- __attribute__ ((__noreturn__));
+extern _Noreturn void __novmx__longjmp (__jmp_buf __env, int __val);
/* Internal function to possibly save the current mask of blocked signals
in ENV, and always set the flag saying whether or not it was saved.
@@ -118,11 +116,10 @@ extern int __novmx__sigjmp_save (__novmx__jmp_buf __env, int __savemask);
extern void _longjmp_unwind (__novmx__jmp_buf env, int val);
-extern void __novmx__libc_siglongjmp (__novmx__sigjmp_buf env, int val)
- __attribute__ ((noreturn));
+extern _Noreturn void __novmx__libc_siglongjmp (__novmx__sigjmp_buf env,
+ int val);
-extern void __novmx__libc_longjmp (__novmx__sigjmp_buf env, int val)
- __attribute__ ((noreturn));
+extern _Noreturn void __novmx__libc_longjmp (__novmx__sigjmp_buf env, int val);
libc_hidden_proto (__novmx__libc_longjmp)
libc_hidden_proto (__novmx_setjmp)
@@ -347,8 +347,7 @@ thread_expire_timer (struct thread_node *self, struct timer_node *timer)
function is to wait on the thread's timer queue and expire the
timers in chronological order as close to their scheduled time as
possible. */
-static void
-__attribute__ ((noreturn))
+static _Noreturn void
thread_func (void *arg)
{
struct thread_node *self = arg;
@@ -38,12 +38,12 @@
two macros and the create_thread function. */
#define START_THREAD_DEFN \
- static int __attribute__ ((noreturn)) start_thread (void *arg)
+ static _Noreturn int start_thread (void *arg)
#define START_THREAD_SELF arg
/* pthread_create.c defines this using START_THREAD_DEFN
We need a forward declaration here so we can take its address. */
-static int start_thread (void *arg) __attribute__ ((noreturn));
+static _Noreturn int start_thread (void *arg);
static int
create_thread (struct pthread *pd, const struct pthread_attr *attr,
@@ -22,7 +22,7 @@
threads in the process if there are any. If there are no other
threads left, then this has the effect of _exit (0). */
-static inline void __attribute__ ((noreturn, always_inline, unused))
+static inline _Noreturn void __attribute__ ((always_inline, unused))
__exit_thread (void)
{
/* Doing this in a loop is mostly just to satisfy the compiler that the
@@ -29,8 +29,7 @@
#define called_from(this, saved) ((this) > (saved))
#endif
-extern void ____longjmp_chk (__jmp_buf __env, int __val)
- __attribute__ ((__noreturn__));
+extern _Noreturn void ____longjmp_chk (__jmp_buf __env, int __val);
void ____longjmp_chk (__jmp_buf env, int val)
{
@@ -216,7 +216,7 @@ extern int pthread_create (pthread_t *__restrict __newthread,
The registered cleanup handlers are called via exception handling
so we cannot mark this function with __THROW.*/
-extern void pthread_exit (void *__retval) __attribute__ ((__noreturn__));
+extern _Noreturn void pthread_exit (void *__retval);
/* Make calling thread wait for termination of the thread TH. The
exit status of the thread is stored in *THREAD_RETURN, if THREAD_RETURN
@@ -707,8 +707,8 @@ extern void __pthread_unregister_cancel_restore (__pthread_unwind_buf_t *__buf)
# endif
/* Internal interface to initiate cleanup. */
-extern void __pthread_unwind_next (__pthread_unwind_buf_t *__buf)
- __cleanup_fct_attribute __attribute__ ((__noreturn__))
+extern _Noreturn void __pthread_unwind_next (__pthread_unwind_buf_t *__buf)
+ __cleanup_fct_attribute
# ifndef SHARED
__attribute__ ((__weak__))
# endif
@@ -22,8 +22,7 @@
/* Can't use "call *%gs:SYSINFO_OFFSET" during statup in static PIE. */
# define I386_USE_SYSENTER 0
-__attribute__ ((__noreturn__))
-static inline void
+static inline _Noreturn void
_startup_fatal (const char *message __attribute__ ((unused)))
{
/* This is only called very early during startup in static PIE.
@@ -43,8 +43,8 @@ struct rbs_flush_values
};
extern struct rbs_flush_values __ia64_flush_rbs (void);
-extern void __ia64_longjmp (__jmp_buf buf, int val, long rnat, long rsc)
- __attribute__ ((__noreturn__));
+extern _Noreturn void __ia64_longjmp (__jmp_buf buf, int val,
+ long rnat, long rsc);
static void
copy_rbs (unsigned long *dst, unsigned long *dst_end, unsigned long dst_rnat,
@@ -21,8 +21,7 @@
#include <pthreadP.h>
#include <jmpbuf-unwind.h>
-extern void __sigstack_longjmp (__jmp_buf, int)
- __attribute__ ((noreturn));
+extern _Noreturn void __sigstack_longjmp (__jmp_buf, int);
/* Like __libc_siglongjmp(), but safe for crossing from alternate
signal stack to normal stack. Needed by NPTL. */
@@ -25,10 +25,8 @@
/* These functions are not declared anywhere since they shouldn't be
used at another place but here. */
-extern void __novmx__libc_siglongjmp (sigjmp_buf env, int val)
- __attribute__ ((noreturn));
-extern void __novmx__libc_longjmp (sigjmp_buf env, int val)
- __attribute__ ((noreturn));
+extern _Noreturn void __novmx__libc_siglongjmp (sigjmp_buf env, int val);
+extern _Noreturn void __novmx__libc_longjmp (sigjmp_buf env, int val);
void __novmx_siglongjmp (sigjmp_buf env, int val)
@@ -27,8 +27,7 @@
# include <setjmp.h>
// XXX Should move to include/setjmp.h
-extern void ____longjmp_chk (__jmp_buf __env, int __val)
- __attribute__ ((__noreturn__));
+extern _Noreturn void ____longjmp_chk (__jmp_buf __env, int __val);
# define __longjmp ____longjmp_chk
# define __libc_siglongjmp __v1__longjmp_chk
@@ -20,8 +20,8 @@
#include <setjmp/longjmp.c>
#undef __libc_longjmp
-extern void __longjmp_cancel (__jmp_buf __env, int __val)
- __attribute__ ((__noreturn__)) attribute_hidden;
+extern _Noreturn void __longjmp_cancel (__jmp_buf __env, int __val)
+ attribute_hidden;
/* Since __libc_longjmp is a private interface for cancellation
implementation in libpthread, there is no need to restore shadow
@@ -53,7 +53,7 @@ _Static_assert ((offsetof (struct pthread_unwind_buf, priv)
#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_22)
-static void __attribute__ ((noreturn, used))
+static _Noreturn void __attribute__ ((used))
longjmp_compat (jmp_buf env, int val)
{
/* NB: We call __libc_siglongjmp, instead of __libc_longjmp, since
--
2.20.1