Make -fno-strict-aliasing unconditional when using GCC. It was intended

to be enabled when the GCC major version was greater than or equal to 4,
but the test was backwards to it was in effect for for versions less
than or equal to 4. So it was in effect already unconditional.
-fstrict-aliasing is supported all the way back in 2.95.2, and I suppose
-fno-strict-aliasing is too.
This commit is contained in:
david 2009-07-22 00:32:57 +00:00
parent cadc08047f
commit c30888e04e
3 changed files with 13 additions and 60 deletions

View file

@ -1,5 +1,10 @@
# Nmap Changelog ($Id$); -*-text-*-
o The -fno-strict-aliasing option is now used unconditionally when
using GCC. It was already this way, in effect, because a test
against the GCC version number was reversed: <= 4 rather than >= 4.
Solar Designer reported the problem.
o Nmap now prints a warning instead of a fatal error when the hardware
address of an interface can't be found. This is the case for
FireWire interfaces, which have a hardware address format not

36
configure vendored
View file

@ -4194,38 +4194,10 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
if test -n "$GXX"; then
CXXFLAGS="$CXXFLAGS -Wall "
fi
{ $as_echo "$as_me:$LINENO: checking whether the compiler is gcc 4 or greater" >&5
$as_echo_n "checking whether the compiler is gcc 4 or greater... " >&6; }
if test x"$GXX" = xno; then
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
else
# On some distros, there are snapshots available as gcc4
if test -z "$ac_cv_prog_CC" || test x"$CC" = xgcc4; then
our_gcc="$CC"
else
our_gcc="$ac_cv_prog_CC"
fi
nmap_gcc_major_version=0
case `$our_gcc --version | sed -e 's,\..*,.,' -e q` in
*4.)
nmap_gcc_major_version=4
;;
esac
if test 4 -ge $nmap_gcc_major_version; then
{ $as_echo "$as_me:$LINENO: result: yes" >&5
$as_echo "yes" >&6; }
CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
else
{ $as_echo "$as_me:$LINENO: result: no" >&5
$as_echo "no" >&6; }
fi
if test -n "$GXX"; then
# -fno-strict-aliasing disables strict-aliasing optimizations that assume
# that pointers of different types never point to the same object.
CXXFLAGS="$CXXFLAGS -Wall -fno-strict-aliasing"
fi
# Remember that all following tests will run with this CXXFLAGS by default

View file

@ -45,34 +45,10 @@ AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
if test -n "$GXX"; then
CXXFLAGS="$CXXFLAGS -Wall "
fi
AC_MSG_CHECKING([whether the compiler is gcc 4 or greater])
if test x"$GXX" = xno; then
AC_MSG_RESULT([no])
else
# On some distros, there are snapshots available as gcc4
if test -z "$ac_cv_prog_CC" || test x"$CC" = xgcc4; then
our_gcc="$CC"
else
our_gcc="$ac_cv_prog_CC"
fi
nmap_gcc_major_version=0
case `$our_gcc --version | sed -e 's,\..*,.,' -e q` in
*4.)
nmap_gcc_major_version=4
;;
esac
if test 4 -ge $nmap_gcc_major_version; then
AC_MSG_RESULT([yes])
CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
else
AC_MSG_RESULT([no])
fi
if test -n "$GXX"; then
# -fno-strict-aliasing disables strict-aliasing optimizations that assume
# that pointers of different types never point to the same object.
CXXFLAGS="$CXXFLAGS -Wall -fno-strict-aliasing"
fi
# Remember that all following tests will run with this CXXFLAGS by default