diff --git a/CHANGELOG b/CHANGELOG index 90830d204..94ce2aa61 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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 diff --git a/configure b/configure index a9aba8495..b50b54182 100755 --- a/configure +++ b/configure @@ -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 diff --git a/configure.ac b/configure.ac index 4f5de3669..d7ea3243d 100644 --- a/configure.ac +++ b/configure.ac @@ -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