bison-patches
[Top][All Lists]
Advanced

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

Re: several messages


From: Joel E. Denny
Subject: Re: several messages
Date: Wed, 16 Dec 2009 14:22:37 -0500 (EST)
User-agent: Alpine 1.00 (DEB 882 2007-12-20)

On Wed, 16 Dec 2009, Joel E. Denny wrote:

> >   Avoid warnings from gcc -Wunused y.tab.c.
> >   Simplify y.tab.c when location tracking is disabled.
> 
> Including the -Wundef correction, I pushed those patches and the following 
> patches to master, branch-2.5, and branch-2.4.2 except that I omitted the 
> b4_locations_if changes from branch-2.4.2.

I also pushed this patch to all three branches to help us avoid this 
problem in the future.

>From a603c6e0bb8b9e79d4136ee0fd0d1bf6a7d010ef Mon Sep 17 00:00:00 2001
From: Joel E. Denny <address@hidden>
Date: Wed, 16 Dec 2009 13:19:19 -0500
Subject: [PATCH] Add gcc's -Wundef to test suite and fix another warning from 
it.

* NEWS (2.4.2): Update description of -Wundef fix.
* configure.ac (WARN_CXXFLAGS_TEST): New substitution.
(WARN_CFLAGS_TEST): New substitution.
* data/glr.c: Avoid warning about __STRICT_ANSI__.
* tests/atlocal.in (CFLAGS): Use WARN_CFLAGS_TEST instead of
WARN_CFLAGS.
(NO_WERROR_CFLAGS): Likewise.
(CXXFLAGS): Use WARN_CXXFLAGS_TEST instead of WARN_CXXFLAGS.
---
 ChangeLog        |   12 ++++++++++++
 NEWS             |    5 +++--
 configure.ac     |    6 ++++++
 data/glr.c       |    3 ++-
 tests/atlocal.in |    6 +++---
 5 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 97c8f6e..2817f11 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 2009-12-16  Joel E. Denny  <address@hidden>
 
+       Add gcc's -Wundef to test suite and fix another warning from it.
+       * NEWS (2.4.2): Update description of -Wundef fix.
+       * configure.ac (WARN_CXXFLAGS_TEST): New substitution.
+       (WARN_CFLAGS_TEST): New substitution.
+       * data/glr.c: Avoid warning about __STRICT_ANSI__.
+       * tests/atlocal.in (CFLAGS): Use WARN_CFLAGS_TEST instead of
+       WARN_CFLAGS.
+       (NO_WERROR_CFLAGS): Likewise.
+       (CXXFLAGS): Use WARN_CXXFLAGS_TEST instead of WARN_CXXFLAGS.
+
+2009-12-16  Joel E. Denny  <address@hidden>
+
        * data/yacc.c: Reformat m4 a little.
 
 2009-12-16  Joel E. Denny  <address@hidden>
diff --git a/NEWS b/NEWS
index 186b8e0..92567dd 100644
--- a/NEWS
+++ b/NEWS
@@ -216,8 +216,9 @@ Bison News
 
 ** Detection of GNU M4 1.4.6 or newer during configure is improved.
 
-** Warnings from gcc's -Wundef option about undefined YYENABLE_NLS and
-   YYLTYPE_IS_TRIVIAL in C/C++ parsers are now avoided.
+** Warnings from gcc's -Wundef option about undefined YYENABLE_NLS,
+   YYLTYPE_IS_TRIVIAL, and __STRICT_ANSI__ in C/C++ parsers are now
+   avoided.
 
 ** %code is now a permanent feature.
 
diff --git a/configure.ac b/configure.ac
index 4f1b20f..8e9fc29 100644
--- a/configure.ac
+++ b/configure.ac
@@ -68,6 +68,12 @@ if test "${enableval}" = yes; then
   gl_WARN_ADD([-Wshadow])
   gl_WARN_ADD([-Wstrict-prototypes])
   AC_SUBST([WARN_CFLAGS])
+  # Warnings for the test suite only.
+  gl_WARN_ADD([-Wundef], [WARN_CFLAGS_TEST])
+  WARN_CXXFLAGS_TEST="$WARN_CXXFLAGS $WARN_CFLAGS_TEST"
+  WARN_CFLAGS_TEST="$WARN_CFLAGS $WARN_CFLAGS_TEST"
+  AC_SUBST([WARN_CXXFLAGS_TEST])
+  AC_SUBST([WARN_CFLAGS_TEST])
   AC_DEFINE([lint], 1, [Define to 1 if the compiler is checking for lint.])
 fi
 
diff --git a/data/glr.c b/data/glr.c
index e73b251..8c964e5 100644
--- a/data/glr.c
+++ b/data/glr.c
@@ -318,7 +318,8 @@ b4_percent_code_get[]dnl
 #ifndef __attribute__
 /* This feature is available in gcc versions 2.5 and later.  */
 # if (! defined __GNUC__ || __GNUC__ < 2 \
-      || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__)
+      || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) \
+      || (defined __STRICT_ANSI__ && __STRICT_ANSI__))
 #  define __attribute__(Spec) /* empty */
 # endif
 #endif
diff --git a/tests/atlocal.in b/tests/atlocal.in
index fb1cef6..7277a59 100644
--- a/tests/atlocal.in
+++ b/tests/atlocal.in
@@ -8,11 +8,11 @@
 : ${CC='@CC@'}
 
 # We want no optimization.
-CFLAGS='@O0CFLAGS@ @WARN_CFLAGS@ @WERROR_CFLAGS@'
+CFLAGS='@O0CFLAGS@ @WARN_CFLAGS_TEST@ @WERROR_CFLAGS@'
 
 # Sometimes a test group needs to ignore gcc warnings, so it locally
 # sets CFLAGS to this.
-NO_WERROR_CFLAGS='@O0CFLAGS@ @WARN_CFLAGS@'
+NO_WERROR_CFLAGS='@O0CFLAGS@ @WARN_CFLAGS_TEST@'
 
 # We need `config.h'.
 CPPFLAGS="-I$abs_top_builddir/lib @CPPFLAGS@"
@@ -27,7 +27,7 @@ GCC='@GCC@'
 BISON_CXX_WORKS='@BISON_CXX_WORKS@'
 
 # We want no optimization with C++, too.
-CXXFLAGS='@O0CXXFLAGS@ @WARN_CXXFLAGS@ @WERROR_CFLAGS@'
+CXXFLAGS='@O0CXXFLAGS@ @WARN_CXXFLAGS_TEST@ @WERROR_CFLAGS@'
 
 # Are special link options needed?
 LDFLAGS='@LDFLAGS@'
-- 
1.5.4.3





reply via email to

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