[Top][All Lists]

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

use of __STDC_VERSION__ > foo in config.h

From: Akim Demaille
Subject: use of __STDC_VERSION__ > foo in config.h
Date: Wed, 9 May 2012 10:38:58 +0200

I just updated gnulib for Bison, and the test suite is
now failing because of commit 2170abddc59962473ce4441596e8a52db5385e54,
especially the following bit:

diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4
index ae4d254..ab3c43d 100644
--- a/m4/gnulib-common.m4
+++ b/m4/gnulib-common.m4
@@ -14,7 +14,7 @@ AC_DEFUN([gl_COMMON], [
 [/* The _Noreturn keyword of C11.  */
-#ifndef _Noreturn
+#if !defined _Noreturn && __STDC_VERSION__ < 201112
 # if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
       || 0x5110 <= __SUNPRO_C)
 #  define _Noreturn __attribute__ ((__noreturn__))

The context: bison generates files which will
be used in situations that we can't imagine or control.
In particular some users are very attached to have warning-free
compilations (which I understand very well) yet they may
enable warnings that are not considered as "relevant" by
gnulibers, typically -Wundef.

In the context of Bison, it is not our call to tell our users
not to use this warning.  So the test suite must use this
warning to check our CPP machineries in the generated
files.  But since our test suite generates programs that
we compile and run, we also need to work around some portability
issues, so we use config.h in the test suite.

Therefore, I would suggest that config.h ought to be -Wundef
free.  Or at least the bits where a warning did occur at some

The attached patch addresses this issue.

Attachment: 0001-config.h-avoid-Wundef-warnings.patch
Description: Binary data

reply via email to

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