This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Prefer _Noreturn to __attribute__ ((__noreturn__)) when either will do


Joseph Myers wrote:
You can of course propose
(with corresponding patch) a change to the style used

Fair enough. (That's what I get for suggesting an improvement.... :-) Proposed patch attached.

(recalling that for
installed headers _Noreturn would reduce portability because of prefix
attributes not working with GCC 2.7),

The attached patch shouldn't reduce portability to GCC 2.7 or earlier, because cdefs.h defines _Noreturn to nothing for these ancient compilers, which merely means they may miss some minor opportunities for optimization when compiling user code.
>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(-)

diff --git a/ChangeLog b/ChangeLog
index c38971ad23..37d8371d6d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/assert/assert.h b/assert/assert.h
index 20fe320043..2512311a81 100644
--- a/assert/assert.h
+++ b/assert/assert.h
@@ -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
diff --git a/benchtests/bench-stpcpy_chk.c b/benchtests/bench-stpcpy_chk.c
index 51d84c3272..869252fc8a 100644
--- a/benchtests/bench-stpcpy_chk.c
+++ b/benchtests/bench-stpcpy_chk.c
@@ -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");
diff --git a/benchtests/bench-strcpy_chk.c b/benchtests/bench-strcpy_chk.c
index 3030763100..d8a0818d50 100644
--- a/benchtests/bench-strcpy_chk.c
+++ b/benchtests/bench-strcpy_chk.c
@@ -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");
diff --git a/crypt/cert.c b/crypt/cert.c
index e070ca398d..2842fe2ab9 100644
--- a/crypt/cert.c
+++ b/crypt/cert.c
@@ -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)
diff --git a/csu/init-first.c b/csu/init-first.c
index 10762b61f5..31bb393a48 100644
--- a/csu/init-first.c
+++ b/csu/init-first.c
@@ -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)
diff --git a/csu/libc-start.c b/csu/libc-start.c
index 5d9c3675fa..cb7cb72cd6 100644
--- a/csu/libc-start.c
+++ b/csu/libc-start.c
@@ -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
diff --git a/csu/version.c b/csu/version.c
index 5d2ae15510..a86d6cdf81 100644
--- a/csu/version.c
+++ b/csu/version.c
@@ -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)
 {
diff --git a/debug/chk_fail.c b/debug/chk_fail.c
index 3dad8838e4..7c26aac178 100644
--- a/debug/chk_fail.c
+++ b/debug/chk_fail.c
@@ -21,8 +21,7 @@
 
 extern char **__libc_argv attribute_hidden;
 
-void
-__attribute__ ((noreturn))
+_Noreturn void
 __chk_fail (void)
 {
   __fortify_fail ("buffer overflow detected");
diff --git a/debug/fortify_fail.c b/debug/fortify_fail.c
index 16549d6dbc..e6364432d8 100644
--- a/debug/fortify_fail.c
+++ b/debug/fortify_fail.c
@@ -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);
diff --git a/debug/stack_chk_fail.c b/debug/stack_chk_fail.c
index 4485655599..25f30a5a5f 100644
--- a/debug/stack_chk_fail.c
+++ b/debug/stack_chk_fail.c
@@ -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");
diff --git a/debug/stack_chk_fail_local.c b/debug/stack_chk_fail_local.c
index ae5aa181a3..b450f0b2cf 100644
--- a/debug/stack_chk_fail_local.c
+++ b/debug/stack_chk_fail_local.c
@@ -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 ();
diff --git a/debug/test-stpcpy_chk.c b/debug/test-stpcpy_chk.c
index 443994517e..49dd9c5d89 100644
--- a/debug/test-stpcpy_chk.c
+++ b/debug/test-stpcpy_chk.c
@@ -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");
diff --git a/debug/test-strcpy_chk.c b/debug/test-strcpy_chk.c
index 49cf8e3b57..b007e22969 100644
--- a/debug/test-strcpy_chk.c
+++ b/debug/test-strcpy_chk.c
@@ -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");
diff --git a/elf/dl-error-skeleton.c b/elf/dl-error-skeleton.c
index 248c185a74..70d8c1b82c 100644
--- a/elf/dl-error-skeleton.c
+++ b/elf/dl-error-skeleton.c
@@ -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)
 {
diff --git a/elf/dl-exception.c b/elf/dl-exception.c
index 7ee19a7fc8..f42b327627 100644
--- a/elf/dl-exception.c
+++ b/elf/dl-exception.c
@@ -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: "
diff --git a/elf/dl-load.c b/elf/dl-load.c
index f972524421..41b57ad5f3 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -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)
 {
diff --git a/elf/dl-minimal.c b/elf/dl-minimal.c
index fdb1341832..50f5286580 100644
--- a/elf/dl-minimal.c
+++ b/elf/dl-minimal.c
@@ -190,8 +190,7 @@ __libc_fatal (const char *message)
 }
 rtld_hidden_def (__libc_fatal)
 
-void
-__attribute__ ((noreturn))
+_Noreturn void
 __chk_fail (void)
 {
   _exit (127);
diff --git a/elf/dl-tls.c b/elf/dl-tls.c
index b425d661be..69448f81da 100644
--- a/elf/dl-tls.c
+++ b/elf/dl-tls.c
@@ -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");
diff --git a/elf/nodelete.c b/elf/nodelete.c
index c8d71152f2..9308d1019b 100644
--- a/elf/nodelete.c
+++ b/elf/nodelete.c
@@ -10,8 +10,7 @@ static sigjmp_buf jmpbuf;
 int fini_ran;
 
 
-static void
-__attribute__ ((noreturn))
+static _Noreturn void
 handler (int sig)
 {
   siglongjmp (jmpbuf, 1);
diff --git a/hurd/hurd.h b/hurd/hurd.h
index 8ccd1714bb..856d0b44b1 100644
--- a/hurd/hurd.h
+++ b/hurd/hurd.h
@@ -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
diff --git a/include/assert.h b/include/assert.h
index 61cc8aa22f..f9b7c1efc2 100644
--- a/include/assert.h
+++ b/include/assert.h
@@ -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)
diff --git a/include/setjmp.h b/include/setjmp.h
index 263bc64b3d..e07e4db0a7 100644
--- a/include/setjmp.h
+++ b/include/setjmp.h
@@ -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)
diff --git a/include/stdio.h b/include/stdio.h
index 65ccabbb05..6b33fe9924 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -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)
 
diff --git a/include/sys/cdefs.h b/include/sys/cdefs.h
index 524fe57a25..a66da39b3f 100644
--- a/include/sys/cdefs.h
+++ b/include/sys/cdefs.h
@@ -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)
 
diff --git a/include/unistd.h b/include/unistd.h
index a043431ecf..8f33081bf6 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -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)
diff --git a/locale/programs/localedef.h b/locale/programs/localedef.h
index 9e2ca7bdcb..e80558dbb1 100644
--- a/locale/programs/localedef.h
+++ b/locale/programs/localedef.h
@@ -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 */
diff --git a/malloc/dynarray.h b/malloc/dynarray.h
index 290a111b87..0188fa4f6a 100644
--- a/malloc/dynarray.h
+++ b/malloc/dynarray.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)
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 6e766d11bc..51d88a1a69 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -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);
diff --git a/malloc/mcheck.c b/malloc/mcheck.c
index 9b6413e657..3a88e1c718 100644
--- a/malloc/mcheck.c
+++ b/malloc/mcheck.c
@@ -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;
diff --git a/malloc/tst-interpose-aux.c b/malloc/tst-interpose-aux.c
index bf86224401..831fe7b8f3 100644
--- a/malloc/tst-interpose-aux.c
+++ b/malloc/tst-interpose-aux.c
@@ -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
diff --git a/malloc/tst-mallocfork2.c b/malloc/tst-mallocfork2.c
index 474b0cea4a..c036e3a6ed 100644
--- a/malloc/tst-mallocfork2.c
+++ b/malloc/tst-mallocfork2.c
@@ -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 ();
diff --git a/misc/bits/error.h b/misc/bits/error.h
index f7a4e7c1b0..7fc9a49867 100644
--- a/misc/bits/error.h
+++ b/misc/bits/error.h
@@ -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
diff --git a/misc/err.h b/misc/err.h
index 4690d04d6a..5cf9707dea 100644
--- a/misc/err.h
+++ b/misc/err.h
@@ -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
 
diff --git a/nptl/createthread.c b/nptl/createthread.c
index 20b7bfa4d1..4ac2e8eb9b 100644
--- a/nptl/createthread.c
+++ b/nptl/createthread.c
@@ -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
diff --git a/nptl/forward.c b/nptl/forward.c
index ed1e7d0350..89c2f939b7 100644
--- a/nptl/forward.c
+++ b/nptl/forward.c
@@ -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 ())
diff --git a/nptl/pt-longjmp.c b/nptl/pt-longjmp.c
index 60e79e43e9..4412b9ade1 100644
--- a/nptl/pt-longjmp.c
+++ b/nptl/pt-longjmp.c
@@ -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);
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
index 626bd4b096..3bfa156337 100644
--- a/nptl/pthreadP.h
+++ b/nptl/pthreadP.h
@@ -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;
diff --git a/nptl/unwind.c b/nptl/unwind.c
index 911fa99b12..aa8a72ba10 100644
--- a/nptl/unwind.c
+++ b/nptl/unwind.c
@@ -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;
diff --git a/nptl/version.c b/nptl/version.c
index 0d992171c8..fa70830123 100644
--- a/nptl/version.c
+++ b/nptl/version.c
@@ -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);
diff --git a/nscd/connections.c b/nscd/connections.c
index a9bc00de90..24d72c7885 100644
--- a/nscd/connections.c
+++ b/nscd/connections.c
@@ -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
diff --git a/nscd/nscd.c b/nscd/nscd.c
index eea1db7ad5..1ce196c79e 100644
--- a/nscd/nscd.c
+++ b/nscd/nscd.c
@@ -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 ();
diff --git a/nscd/nscd.h b/nscd/nscd.h
index 9b837cf4a7..748cf11755 100644
--- a/nscd/nscd.h
+++ b/nscd/nscd.h
@@ -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,
diff --git a/posix/unistd.h b/posix/unistd.h
index 55a989f7bb..0cfe57a08b 100644
--- a/posix/unistd.h
+++ b/posix/unistd.h
@@ -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';
diff --git a/resolv/gai_misc.c b/resolv/gai_misc.c
index 69d7086ae6..d0a2313be4 100644
--- a/resolv/gai_misc.c
+++ b/resolv/gai_misc.c
@@ -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;
diff --git a/setjmp/bits/setjmp2.h b/setjmp/bits/setjmp2.h
index 8fc6b89cb4..3c352cce4b 100644
--- a/setjmp/bits/setjmp2.h
+++ b/setjmp/bits/setjmp2.h
@@ -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
diff --git a/setjmp/setjmp.h b/setjmp/setjmp.h
index 3d09c98cc9..9517b9e211 100644
--- a/setjmp/setjmp.h
+++ b/setjmp/setjmp.h
@@ -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.  */
 
 
diff --git a/setjmp/tst-setjmp.c b/setjmp/tst-setjmp.c
index b377393ecf..e1c5912523 100644
--- a/setjmp/tst-setjmp.c
+++ b/setjmp/tst-setjmp.c
@@ -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);
diff --git a/stdlib/exit.h b/stdlib/exit.h
index 6fab49c94f..e6d981939f 100644
--- a/stdlib/exit.h
+++ b/stdlib/exit.h
@@ -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)
diff --git a/stdlib/stdlib.h b/stdlib/stdlib.h
index 15debe1e31..861a355e5d 100644
--- a/stdlib/stdlib.h
+++ b/stdlib/stdlib.h
@@ -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
 
 
diff --git a/stdlib/tst-random.c b/stdlib/tst-random.c
index 8fe0993dd7..1b51f36a59 100644
--- a/stdlib/tst-random.c
+++ b/stdlib/tst-random.c
@@ -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)
diff --git a/sunrpc/proto.h b/sunrpc/proto.h
index ea28565b1e..fba72cd6aa 100644
--- a/sunrpc/proto.h
+++ b/sunrpc/proto.h
@@ -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);
diff --git a/sunrpc/rpc_main.c b/sunrpc/rpc_main.c
index c6607848cc..0375f2141f 100644
--- a/sunrpc/rpc_main.c
+++ b/sunrpc/rpc_main.c
@@ -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);
diff --git a/sunrpc/rpc_scan.h b/sunrpc/rpc_scan.h
index 9786a513b9..6ec6e9f945 100644
--- a/sunrpc/rpc_scan.h
+++ b/sunrpc/rpc_scan.h
@@ -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);
diff --git a/sunrpc/svc_tcp.c b/sunrpc/svc_tcp.c
index 484574c11a..face87c940 100644
--- a/sunrpc/svc_tcp.c
+++ b/sunrpc/svc_tcp.c
@@ -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.  */
diff --git a/sunrpc/svc_unix.c b/sunrpc/svc_unix.c
index eac1ae8fb9..332e82b8ea 100644
--- a/sunrpc/svc_unix.c
+++ b/sunrpc/svc_unix.c
@@ -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.  */
diff --git a/support/check.h b/support/check.h
index eb3d2487a7..549df61d80 100644
--- a/support/check.h
+++ b/support/check.h
@@ -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
diff --git a/support/support_test_main.c b/support/support_test_main.c
index 7e7b9edbb0..1d9569faea 100644
--- a/support/support_test_main.c
+++ b/support/support_test_main.c
@@ -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;
diff --git a/sysdeps/arm/unwind.h b/sysdeps/arm/unwind.h
index 02b0401dec..307790ae50 100644
--- a/sysdeps/arm/unwind.h
+++ b/sysdeps/arm/unwind.h
@@ -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)
diff --git a/sysdeps/generic/exit-thread.h b/sysdeps/generic/exit-thread.h
index f6af6e7e5e..d37318174e 100644
--- a/sysdeps/generic/exit-thread.h
+++ b/sysdeps/generic/exit-thread.h
@@ -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)
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
index 37cab6f06b..1a91b3c461 100644
--- a/sysdeps/generic/ldsodefs.h
+++ b/sysdeps/generic/ldsodefs.h
@@ -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,
diff --git a/sysdeps/htl/pthread.h b/sysdeps/htl/pthread.h
index a8205519f2..9ea1d40efd 100644
--- a/sysdeps/htl/pthread.h
+++ b/sysdeps/htl/pthread.h
@@ -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.  */
diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h
index c666fb94e7..5db006bc43 100644
--- a/sysdeps/htl/pthreadP.h
+++ b/sysdeps/htl/pthreadP.h
@@ -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 *);
diff --git a/sysdeps/ia64/jmpbuf-unwind.h b/sysdeps/ia64/jmpbuf-unwind.h
index a84e765616..9302a8d321 100644
--- a/sysdeps/ia64/jmpbuf-unwind.h
+++ b/sysdeps/ia64/jmpbuf-unwind.h
@@ -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)
diff --git a/sysdeps/nptl/futex-internal.h b/sysdeps/nptl/futex-internal.h
index 86a0818072..8530ab6b92 100644
--- a/sysdeps/nptl/futex-internal.h
+++ b/sysdeps/nptl/futex-internal.h
@@ -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");
diff --git a/sysdeps/nptl/pthread.h b/sysdeps/nptl/pthread.h
index 704a3c48d6..f9fed919c9 100644
--- a/sysdeps/nptl/pthread.h
+++ b/sysdeps/nptl/pthread.h
@@ -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
diff --git a/sysdeps/nptl/threads.h b/sysdeps/nptl/threads.h
index ef08337b7b..6b0882351e 100644
--- a/sysdeps/nptl/threads.h
+++ b/sysdeps/nptl/threads.h
@@ -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).  */
diff --git a/sysdeps/powerpc/longjmp.c b/sysdeps/powerpc/longjmp.c
index 05b7b97fe0..cdfd1783d7 100644
--- a/sysdeps/powerpc/longjmp.c
+++ b/sysdeps/powerpc/longjmp.c
@@ -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
diff --git a/sysdeps/powerpc/novmxsetjmp.h b/sysdeps/powerpc/novmxsetjmp.h
index 0dd5cad9cc..b8cee84698 100644
--- a/sysdeps/powerpc/novmxsetjmp.h
+++ b/sysdeps/powerpc/novmxsetjmp.h
@@ -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)
diff --git a/sysdeps/pthread/timer_routines.c b/sysdeps/pthread/timer_routines.c
index 54d7d5b06c..e9df9a0cde 100644
--- a/sysdeps/pthread/timer_routines.c
+++ b/sysdeps/pthread/timer_routines.c
@@ -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;
diff --git a/sysdeps/unix/sysv/linux/createthread.c b/sysdeps/unix/sysv/linux/createthread.c
index 579bd94743..5cf4f28f6a 100644
--- a/sysdeps/unix/sysv/linux/createthread.c
+++ b/sysdeps/unix/sysv/linux/createthread.c
@@ -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,
diff --git a/sysdeps/unix/sysv/linux/exit-thread.h b/sysdeps/unix/sysv/linux/exit-thread.h
index 5c8f665e96..8629beae27 100644
--- a/sysdeps/unix/sysv/linux/exit-thread.h
+++ b/sysdeps/unix/sysv/linux/exit-thread.h
@@ -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
diff --git a/sysdeps/unix/sysv/linux/generic/____longjmp_chk.c b/sysdeps/unix/sysv/linux/generic/____longjmp_chk.c
index c918616f3e..24c1188dc0 100644
--- a/sysdeps/unix/sysv/linux/generic/____longjmp_chk.c
+++ b/sysdeps/unix/sysv/linux/generic/____longjmp_chk.c
@@ -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)
 {
diff --git a/sysdeps/unix/sysv/linux/hppa/pthread.h b/sysdeps/unix/sysv/linux/hppa/pthread.h
index 45e706c037..42f867a789 100644
--- a/sysdeps/unix/sysv/linux/hppa/pthread.h
+++ b/sysdeps/unix/sysv/linux/hppa/pthread.h
@@ -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
diff --git a/sysdeps/unix/sysv/linux/i386/startup.h b/sysdeps/unix/sysv/linux/i386/startup.h
index a3b5e30947..3cd835d0a9 100644
--- a/sysdeps/unix/sysv/linux/i386/startup.h
+++ b/sysdeps/unix/sysv/linux/i386/startup.h
@@ -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.
diff --git a/sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c b/sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c
index 967b7cfde0..687ad298ae 100644
--- a/sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c
+++ b/sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c
@@ -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,
diff --git a/sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c b/sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c
index 67334a6045..6d182765eb 100644
--- a/sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c
+++ b/sysdeps/unix/sysv/linux/ia64/unwind_longjmp.c
@@ -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.  */
diff --git a/sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c b/sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c
index fe75bd193c..72f50f194c 100644
--- a/sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c
+++ b/sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c
@@ -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)
diff --git a/sysdeps/unix/sysv/linux/s390/longjmp_chk.c b/sysdeps/unix/sysv/linux/s390/longjmp_chk.c
index e941e74e3c..a5c64bff8a 100644
--- a/sysdeps/unix/sysv/linux/s390/longjmp_chk.c
+++ b/sysdeps/unix/sysv/linux/s390/longjmp_chk.c
@@ -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
diff --git a/sysdeps/x86/longjmp.c b/sysdeps/x86/longjmp.c
index 6e5e391ef8..7c34e8fda2 100644
--- a/sysdeps/x86/longjmp.c
+++ b/sysdeps/x86/longjmp.c
@@ -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
diff --git a/sysdeps/x86/nptl/pt-longjmp.c b/sysdeps/x86/nptl/pt-longjmp.c
index 751dcf3fc3..782f838877 100644
--- a/sysdeps/x86/nptl/pt-longjmp.c
+++ b/sysdeps/x86/nptl/pt-longjmp.c
@@ -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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]