bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 01/19] * m4/gnulib-common.m4 (gl_COMMON_BODY): Add _Noreturn.


From: Paul Eggert
Subject: [PATCH 01/19] * m4/gnulib-common.m4 (gl_COMMON_BODY): Add _Noreturn.
Date: Sun, 10 Jul 2011 22:19:14 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110516 Thunderbird/3.1.10

This is the first of a proposed series of patches to:

(1) add support for the draft C1X _Noreturn keyword,
(2) add support for the draft C1X <stdnoreturn.h> include, and
(3) have the rest of gnulib use (1) and (2)

Comments (as usual) are welcome.

---
 ChangeLog           |    4 ++++
 m4/gnulib-common.m4 |   13 ++++++++++++-
 2 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 41e97e2..000365f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-07-10  Paul Eggert  <address@hidden>
+
+       * m4/gnulib-common.m4 (gl_COMMON_BODY): Add _Noreturn.
+
 2011-07-09  Paul Eggert  <address@hidden>
 
        stdint: respect system's intmax_t if INTMAX_MAX
diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4
index 843efe0..f3f0a7d 100644
--- a/m4/gnulib-common.m4
+++ b/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 26
+# gnulib-common.m4 serial 27
 dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -12,6 +12,17 @@ AC_DEFUN([gl_COMMON], [
   AC_REQUIRE([gl_COMMON_BODY])
 ])
 AC_DEFUN([gl_COMMON_BODY], [
+  AH_VERBATIM([_Noreturn],
+[/* The _Noreturn keyword of draft C1X.  */
+#if ! defined _Noreturn && __STDC_VERSION__ < 201000L
+# if (3 <= __GNUC__ || __GNUC__ == 2 && 8 <= __GNUC_MINOR__ \
+      || 0x5110 <= __SUNPRO_C)
+#  define _Noreturn __attribute__ ((__noreturn__))
+# else
+#  define _Noreturn
+# endif
+#endif
+])
   AH_VERBATIM([isoc99_inline],
 [/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports
    the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of
-- 
1.7.4.4



reply via email to

[Prev in Thread] Current Thread [Next in Thread]