mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-22 18:53:04 +00:00
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.
This commit is contained in:
@@ -111,6 +111,8 @@ if test "$enable_gcc_warnings" = yes; then
|
|||||||
# Warnings for the test suite only.
|
# Warnings for the test suite only.
|
||||||
gl_WARN_ADD([-Wundef], [WARN_CXXFLAGS_TEST])
|
gl_WARN_ADD([-Wundef], [WARN_CXXFLAGS_TEST])
|
||||||
gl_WARN_ADD([-pedantic], [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
|
CXXFLAGS=$save_CXXFLAGS
|
||||||
AC_LANG_POP([C++])
|
AC_LANG_POP([C++])
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -16,6 +16,10 @@
|
|||||||
dist_noinst_SCRIPTS = examples/extexi examples/test
|
dist_noinst_SCRIPTS = examples/extexi examples/test
|
||||||
TEST_LOG_COMPILER = $(top_srcdir)/examples/test
|
TEST_LOG_COMPILER = $(top_srcdir)/examples/test
|
||||||
|
|
||||||
|
AM_CXXFLAGS = \
|
||||||
|
$(NO_STRICT_ALIAS_CXXFLAGS) \
|
||||||
|
$(WARN_CXXFLAGS) $(WARN_CXXFLAGS_TEST) $(WERROR_CXXFLAGS)
|
||||||
|
|
||||||
## ------------ ##
|
## ------------ ##
|
||||||
## Extracting. ##
|
## Extracting. ##
|
||||||
## ------------ ##
|
## ------------ ##
|
||||||
|
|||||||
@@ -38,6 +38,9 @@ NO_WERROR_CXXFLAGS='@CXXFLAGS@ @WARN_CXXFLAGS@ @WARN_CXXFLAGS_TEST@'
|
|||||||
CFLAGS="$NO_WERROR_CFLAGS @WERROR_CFLAGS@"
|
CFLAGS="$NO_WERROR_CFLAGS @WERROR_CFLAGS@"
|
||||||
CXXFLAGS="$NO_WERROR_CXXFLAGS @WERROR_CXXFLAGS@"
|
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 ':'.
|
# If 'exit 77'; skip all C++ tests; otherwise ':'.
|
||||||
BISON_CXX_WORKS='@BISON_CXX_WORKS@'
|
BISON_CXX_WORKS='@BISON_CXX_WORKS@'
|
||||||
|
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ main ()
|
|||||||
]])
|
]])
|
||||||
|
|
||||||
AT_BISON_CHECK([-o list.cc list.yy])
|
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,
|
AT_PARSER_CHECK([./list], 0,
|
||||||
[(0, 1, 2, 4)
|
[(0, 1, 2, 4)
|
||||||
])
|
])
|
||||||
|
|||||||
Reference in New Issue
Block a user