bison-patches
[Top][All Lists]
Advanced

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

{master} tests: use -fno-strict-aliasing with variants


From: Akim Demaille
Subject: {master} tests: use -fno-strict-aliasing with variants
Date: Mon, 26 Nov 2012 11:01:39 +0100

commit 15a1a08a877cfe0ab231d59a5c19201b98df04be
Author: Akim Demaille <address@hidden>
Date:   Mon Nov 26 10:42:43 2012 +0100

    tests: remove leftover
    
    * tests/atlocal.in: Remove duplicate handling of --compile-c-with-cxx.

diff --git a/tests/atlocal.in b/tests/atlocal.in
index 16e6fda..649e074 100644
--- a/tests/atlocal.in
+++ b/tests/atlocal.in
@@ -88,9 +88,3 @@ if env | grep '^POSIXLY_CORRECT=' >/dev/null; then
 else
   POSIXLY_CORRECT_IS_EXPORTED=false
 fi
-
-# Handle --compile-c-with-cxx here, once CXX and CXXFLAGS are known.
-if "$at_arg_compile_c_with_cxx"; then
-  CC=$CXX
-  CFLAGS=$CXXFLAGS
-fi

commit 2f130f199a5510f6aa7ac6199e34885242411039
Author: Akim Demaille <address@hidden>
Date:   Mon Nov 26 10:42:49 2012 +0100

    tests: use -fno-strict-aliasing with variants
    
    Reported by Théophile Ranquet.
    
    * configure.ac (NO_STRICT_ALIAS_CXXFLAGS): New.
    * tests/c++.at, tests/atlocal.in, examples/local.mk: Use it.

diff --git a/configure.ac b/configure.ac
index aec681a..a4eb373 100644
--- a/configure.ac
+++ b/configure.ac
@@ -111,6 +111,8 @@ if test "$enable_gcc_warnings" = yes; then
   # Warnings for the test suite only.
   gl_WARN_ADD([-Wundef], [WARN_CXXFLAGS_TEST])
   gl_WARN_ADD([-pedantic], [WARN_CXXFLAGS_TEST])
+  # Variants break strict aliasing analysis.
+  gl_WARN_ADD([-fno-strict-aliasing], [NO_STRICT_ALIAS_CXXFLAGS])
   CXXFLAGS=$save_CXXFLAGS
   AC_LANG_POP([C++])
 fi
diff --git a/examples/local.mk b/examples/local.mk
index 94a3167..3a6fcf0 100644
--- a/examples/local.mk
+++ b/examples/local.mk
@@ -16,6 +16,10 @@
 dist_noinst_SCRIPTS = examples/extexi examples/test
 TEST_LOG_COMPILER = $(top_srcdir)/examples/test
 
+AM_CXXFLAGS =                                                  \
+  $(NO_STRICT_ALIAS_CXXFLAGS)                                  \
+  $(WARN_CXXFLAGS) $(WARN_CXXFLAGS_TEST) $(WERROR_CXXFLAGS)
+
 ## ------------ ##
 ## Extracting.  ##
 ## ------------ ##
diff --git a/tests/atlocal.in b/tests/atlocal.in
index 649e074..a545e5e 100644
--- a/tests/atlocal.in
+++ b/tests/atlocal.in
@@ -38,6 +38,9 @@ NO_WERROR_CXXFLAGS='@CXXFLAGS@ @WARN_CXXFLAGS@ 
@WARN_CXXFLAGS_TEST@'
   CFLAGS="$NO_WERROR_CFLAGS   @WERROR_CFLAGS@"
 CXXFLAGS="$NO_WERROR_CXXFLAGS @WERROR_CXXFLAGS@"
 
+# C++ variants break strict aliasing analysis.
+NO_STRICT_ALIAS_CXXFLAGS='@NO_STRICT_ALIAS_CXXFLAGS@'
+
 # If 'exit 77'; skip all C++ tests; otherwise ':'.
 BISON_CXX_WORKS='@BISON_CXX_WORKS@'
 
diff --git a/tests/c++.at b/tests/c++.at
index f5e5f46..08040d6 100644
--- a/tests/c++.at
+++ b/tests/c++.at
@@ -176,7 +176,7 @@ main ()
 ]])
 
 AT_BISON_CHECK([-o list.cc list.yy])
-AT_COMPILE_CXX([list])
+AT_COMPILE_CXX([list], [$NO_STRICT_ALIAS_CXXFLAGS list.cc])
 AT_PARSER_CHECK([./list], 0,
 [(0, 1, 2, 4)
 ])




reply via email to

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