changeset 16845:1118b1dc4eab

_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>.
author Paul Eggert <eggert@cs.ucla.edu>
date Thu, 10 May 2012 08:59:49 -0700
parents d6e95ab13906
children a80d21de5373
files ChangeLog m4/gnulib-common.m4
diffstat 2 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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.
--- a/m4/gnulib-common.m4
+++ b/m4/gnulib-common.m4
@@ -14,7 +14,8 @@
 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__))