Commit 62982aae authored by Roland Levillain's avatar Roland Levillain
Browse files

Work around g++ 4.2's behavior regarding strict aliasing.

	* configure.ac: Set STRICT_ALIASING_CXXFLAGS to
	`-fno-strict-aliasing' when the compiler is g++ 4.2.
parent 2891ae77
2010-04-23 Roland Levillain <roland@lrde.epita.fr>
Work around g++ 4.2's behavior regarding strict aliasing.
* configure.ac: Set STRICT_ALIASING_CXXFLAGS to
`-fno-strict-aliasing' when the compiler is g++ 4.2.
2010-04-21 Roland Levillain <roland@lrde.epita.fr>
Catch up with the new interface of Scribo's unit tests generator.
......
......@@ -47,10 +47,25 @@ fi
AC_LANG([C++])
AC_PROG_CXX
# Speed up compiling times.
# GNU C++ compiler setup.
if test "$GXX" = yes; then
# Speed up compiling times.
CXXFLAGS="$CXXFLAGS -pipe"
# The code generated for mln::data::impl::memcpy__() by g++ 4.2 with
# a high optimization level (`-O3') and without
# `-fno-strict-aliasing' might be wrong, at least with Debian's g++
# 4.2 on IA-32 (see also milena/mln/memcpy_.hh). We observed this
# behavior with e.g. milena/apps/graph-morpho/samples-image2d.cc.
# Note that Debian's g++ 4.0, 4.1, 4.3 and 4.4 are fine.
#
# So, when the C++ compiler is g++ 4.2, set STRICT_ALIASING_CXXFLAGS
# to `-fno-strict-aliasing'.
if $CXX --version | head -n 1 | grep '\b4\.2' >/dev/null 2>&1; then
STRICT_ALIASING_CXXFLAGS=-fno-strict-aliasing
fi
fi
AC_SUBST([STRICT_ALIASING_CXXFLAGS])
# Adjusting warning options according to compilers.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment