bpo-5755: Move -Wstrict-prototypes to CFLAGS_NODIST (GH-7395) · python/cpython@d59f97c (original) (raw)

Original file line number Diff line number Diff line change
@@ -6865,9 +6865,6 @@ if test "${OPT-unset}" = "unset"
6865 6865 then
6866 6866 case $GCC in
6867 6867 yes)
6868 -if test "$CC" != 'g++' ; then
6869 - STRICT_PROTO="-Wstrict-prototypes"
6870 -fi
6871 6868 # For gcc 4.x we need to use -fwrapv so lets check if its supported
6872 6869 if "$CC" -v --help 2>/dev/null |grep -- -fwrapv > /dev/null; then
6873 6870 WRAP="-fwrapv"
@@ -6914,8 +6911,6 @@ then
6914 6911 ;;
6915 6912 esac
6916 6913
6917 - OPT="$OPT $STRICT_PROTO"
6918 -
6919 6914 case $ac_sys_system in
6920 6915 SCO_SV*) OPT="$OPT -m486 -DSCO5"
6921 6916 ;;
@@ -7324,6 +7319,47 @@ fi
7324 7319 { asecho"as_echo "asecho"as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_unreachable_code_warning" >&5
7325 7320 asecho"as_echo "asecho"ac_cv_enable_unreachable_code_warning" >&6; }
7326 7321
7322 + { asecho"as_echo "asecho"as_me:${as_lineno-$LINENO}: checking if we can turn on $CC strict-prototypes warning" >&5
7323 +$as_echo_n "checking if we can turn on $CC strict-prototypes warning... " >&6; }
7324 + ac_save_cc="$CC"
7325 + CC="$CC -Werror -Wstrict-prototypes"
7326 +if ${ac_cv_enable_enable_strict_prototypes_warning+:} false; then :
7327 +$as_echo_n "(cached) " >&6
7328 +else
7329 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7330 +/* end confdefs.h. */
7331 +
7332 +
7333 +int
7334 +main ()
7335 +{
7336 +
7337 + ;
7338 + return 0;
7339 +}
7340 +
7341 +_ACEOF
7342 +if ac_fn_c_try_compile "$LINENO"; then :
7343 +
7344 + ac_cv_enable_strict_prototypes_warning=yes
7345 +
7346 +else
7347 +
7348 + ac_cv_enable_strict_prototypes_warning=no
7349 +
7350 +fi
7351 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7352 +fi
7353 +
7354 + CC="$ac_save_cc"
7355 + { asecho"as_echo "asecho"as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_strict_prototypes_warning" >&5
7356 +$as_echo "$ac_cv_enable_strict_prototypes_warning" >&6; }
7357 +
7358 +if test $ac_cv_enable_strict_prototypes_warning = yes
7359 +then
7360 + CFLAGS_NODIST="$CFLAGS_NODIST -Wstrict-prototypes"
7361 +fi
7362 +
7327 7363 # if using gcc on alpha, use -mieee to get (near) full IEEE 754
7328 7364 # support. Without this, treatment of subnormals doesn't follow
7329 7365 # the standard.