summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel E. Denny <joeldenny@joeldenny.org>2011-08-21 13:07:16 -0400
committerJoel E. Denny <joeldenny@joeldenny.org>2011-08-21 17:15:26 -0400
commitd63311dfb967f077bde57ee34e72604edbde80ab (patch)
treee3315e9fd50456b2f0dc998558df89b40ca1e3da
parent765e1bd4fc08bdee636b8aeab12908d8895ece67 (diff)
downloadbison-d63311dfb967f077bde57ee34e72604edbde80ab.tar.gz
tests: add -pedantic for --enable-gcc-warnings.
This should help to avoid some portability problems. For example, it would have revealed the empty unions fixed by the last patch * configure.ac (WARN_CFLAGS_TESTS, WARN_CXXFLAGS_TEST): Implement. * tests/synclines.at (AT_TEST_SYNCLINE): Avoid -pedantic warning about an empty translation unit. (cherry picked from commit 5422d56a718805a2470558808355e04182a12d65)
-rw-r--r--ChangeLog9
-rw-r--r--configure.ac7
-rw-r--r--tests/synclines.at1
3 files changed, 13 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 3da26ebc..ced339c8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2011-08-21 Joel E. Denny <joeldenny@joeldenny.org>
+ tests: add -pedantic for --enable-gcc-warnings.
+ This should help to avoid some portability problems. For example,
+ it would have revealed the empty unions fixed by the last patch
+ * configure.ac (WARN_CFLAGS_TESTS, WARN_CXXFLAGS_TEST): Implement.
+ * tests/synclines.at (AT_TEST_SYNCLINE): Avoid -pedantic warning
+ about an empty translation unit.
+
+2011-08-21 Joel E. Denny <joeldenny@joeldenny.org>
+
tests: fix empty unions.
Empty unions are not accepted by the ISO C99 grammar or by at
least some versions of Sun Studio. Reported by Wolfgang S. Kechel
diff --git a/configure.ac b/configure.ac
index 258e6bb1..a98bc952 100644
--- a/configure.ac
+++ b/configure.ac
@@ -82,10 +82,9 @@ if test "${enableval}" = yes; then
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])
+ gl_WARN_ADD([-pedantic], [WARN_CFLAGS_TEST])
+ AC_SUBST([WARN_CXXFLAGS_TEST], ["$WARN_CXXFLAGS $WARN_CFLAGS_TEST"])
+ AC_SUBST([WARN_CFLAGS_TEST], ["$WARN_CFLAGS $WARN_CFLAGS_TEST"])
fi
BISON_TEST_FOR_WORKING_C_COMPILER
diff --git a/tests/synclines.at b/tests/synclines.at
index cc2a7229..42b2a667 100644
--- a/tests/synclines.at
+++ b/tests/synclines.at
@@ -88,6 +88,7 @@ m4_define([AT_TEST_SYNCLINE],
AT_DATA([syncline.c],
[[#error "1"
+int i; // avoids -pedantic warning about an empty translation unit
]])
AT_SYNCLINES_COMPILE([syncline.c])