_Noreturn: port config.h to gcc -Wundef
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 10 May 2012 15:59:49 +0000 (08:59 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 10 May 2012 16:00:20 +0000 (09:00 -0700)
* m4/gnulib-common.m4 (gl_COMMON_BODY): Check that __STDC_VERSION__ is
defined before using it, for gcc -Wundef.  Reported by Akim Demaille in
<http://lists.gnu.org/archive/html/bug-gnulib/2012-05/msg00147.html>.

ChangeLog
m4/gnulib-common.m4

index 29df987..9edbd9c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-05-10  Paul Eggert  <eggert@cs.ucla.edu>
+
+       _Noreturn: port config.h to gcc -Wundef
+       * m4/gnulib-common.m4 (gl_COMMON_BODY): Check that __STDC_VERSION__ is
+       defined before using it, for gcc -Wundef.  Reported by Akim Demaille in
+       <http://lists.gnu.org/archive/html/bug-gnulib/2012-05/msg00147.html>.
+
 2012-05-10  Bruno Haible  <bruno@clisp.org>
 
        system-quote: Refactor.
index ab3c43d..d62b767 100644 (file)
@@ -14,7 +14,8 @@ AC_DEFUN([gl_COMMON], [
 AC_DEFUN([gl_COMMON_BODY], [
   AH_VERBATIM([_Noreturn],
 [/* The _Noreturn keyword of C11.  */
-#if !defined _Noreturn && __STDC_VERSION__ < 201112
+#if ! (defined _Noreturn \
+       || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__))
 # if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
       || 0x5110 <= __SUNPRO_C)
 #  define _Noreturn __attribute__ ((__noreturn__))