[PATCH 1/2] misc/sys/cdefs.h: Add _Noreturn macro for pre-C11 compilers

Will Newton will.newton@linaro.org
Mon Jun 23 16:13:00 GMT 2014


From: Paul Eggert <eggert@cs.ucla.edu>

2014-03-28  Paul Eggert  <eggert@cs.ucla.edu>

	* misc/sys/cdefs.h (_Noreturn): New macro, for pre-C11 compilers.
---
 misc/sys/cdefs.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h
index 4d958ea..a5c3224 100644
--- a/misc/sys/cdefs.h
+++ b/misc/sys/cdefs.h
@@ -382,6 +382,14 @@
 # define __glibc_likely(cond)	(cond)
 #endif
 
+#if !defined _Noreturn && __STDC_VERSION__ < 201112 && !__GNUC_PREREQ (4,7)
+# if __GNUC_PREREQ (2,8)
+#  define _Noreturn __attribute__ ((__noreturn__))
+# else
+#  define _Noreturn
+# endif
+#endif
+
 #include <bits/wordsize.h>
 
 #if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
-- 
1.9.3



More information about the Libc-alpha mailing list