From: Guy Harris Date: Sun, 12 May 2013 19:30:01 +0000 (-0700) Subject: HP C isn't the only compiler on which we must avoid GCC-style -W flags. X-Git-Tag: tcpdump-4.5.0~80^2~7 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/60f8354159a2d5a2bf5ef29bb0aa03a55197466c?ds=sidebyside HP C isn't the only compiler on which we must avoid GCC-style -W flags. MIPS C and DEC C also can't be made to reliably Just Say No to those flags, and they don't support those flags, so don't try them with those compilers either. --- diff --git a/aclocal.m4 b/aclocal.m4 index 131283be..34e03fce 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -173,13 +173,24 @@ AC_DEFUN(AC_LBL_C_INIT, hpux*) # - # Note that this is HP C, because we have to - # treat it specially below. + # HP C, which is what we presume we're using, doesn't + # exit with a non-zero exit status if we hand it an + # invalid -W flag, can't be forced to do so even with + # +We, and doesn't handle GCC-style -W flags, so we + # don't want to try using GCC-style -W flags. # - ac_lbl_cc_is_hp_c=yes + ac_lbl_cc_dont_try_gcc_dashW=yes ;; irix*) + # + # MIPS C, which is what we presume we're using, doesn't + # necessarily exit with a non-zero exit status if we + # hand it an invalid -W flag, can't be forced to do + # so, and doesn't handle GCC-style -W flags, so we + # don't want to try using GCC-style -W flags. + # + ac_lbl_cc_dont_try_gcc_dashW=yes $1="$$1 -xansi -signed -O" ;; @@ -188,6 +199,13 @@ AC_DEFUN(AC_LBL_C_INIT, # Presumed to be DEC OSF/1, Digital UNIX, or # Tru64 UNIX. # + # The DEC C compiler, which is what we presume we're + # using, doesn't exit with a non-zero exit status if we + # hand it an invalid -W flag, can't be forced to do + # so, and doesn't handle GCC-style -W flags, so we + # don't want to try using GCC-style -W flags. + # + ac_lbl_cc_dont_try_gcc_dashW=yes $1="$$1 -O" ;; @@ -998,7 +1016,7 @@ AC_DEFUN(AC_LBL_DEVEL, # We therefore skip all the warning option stuff # on HP-UX. # - if test "$ac_lbl_cc_is_hp_c" != yes; then + if test "$ac_lbl_cc_dont_try_gcc_dashW" != yes; then AC_LBL_CHECK_UNKNOWN_WARNING_OPTION_ERROR() AC_LBL_CHECK_COMPILER_OPT($1, -Wall) AC_LBL_CHECK_COMPILER_OPT($1, -Wmissing-prototypes) diff --git a/configure b/configure index 68af1c33..f2bf7878 100755 --- a/configure +++ b/configure @@ -3049,13 +3049,24 @@ echo "$as_me: error: see the INSTALL doc for more info" >&2;} hpux*) # - # Note that this is HP C, because we have to - # treat it specially below. + # HP C, which is what we presume we're using, doesn't + # exit with a non-zero exit status if we hand it an + # invalid -W flag, can't be forced to do so even with + # +We, and doesn't handle GCC-style -W flags, so we + # don't want to try using GCC-style -W flags. # - ac_lbl_cc_is_hp_c=yes + ac_lbl_cc_dont_try_gcc_dashW=yes ;; irix*) + # + # MIPS C, which is what we presume we're using, doesn't + # necessarily exit with a non-zero exit status if we + # hand it an invalid -W flag, can't be forced to do + # so, and doesn't handle GCC-style -W flags, so we + # don't want to try using GCC-style -W flags. + # + ac_lbl_cc_dont_try_gcc_dashW=yes V_CCOPT="$V_CCOPT -xansi -signed -O" ;; @@ -3064,6 +3075,13 @@ echo "$as_me: error: see the INSTALL doc for more info" >&2;} # Presumed to be DEC OSF/1, Digital UNIX, or # Tru64 UNIX. # + # The DEC C compiler, which is what we presume we're + # using, doesn't exit with a non-zero exit status if we + # hand it an invalid -W flag, can't be forced to do + # so, and doesn't handle GCC-style -W flags, so we + # don't want to try using GCC-style -W flags. + # + ac_lbl_cc_dont_try_gcc_dashW=yes V_CCOPT="$V_CCOPT -O" ;; @@ -11307,7 +11325,7 @@ rm -f os-proto.h # We therefore skip all the warning option stuff # on HP-UX. # - if test "$ac_lbl_cc_is_hp_c" != yes; then + if test "$ac_lbl_cc_dont_try_gcc_dashW" != yes; then { echo "$as_me:$LINENO: checking whether the compiler fails when given an unknown warning option" >&5 echo $ECHO_N "checking whether the compiler fails when given an unknown warning option... $ECHO_C" >&6; }