bpo-5755: Move -Wstrict-prototypes to CFLAGS_NODIST (GH-7395)

This commit is contained in:
INADA Naoki 2018-06-05 20:40:53 +09:00 committed by GitHub
parent 5f48e2644d
commit e336484847
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 64 additions and 10 deletions

View file

@ -1421,9 +1421,6 @@ if test "${OPT-unset}" = "unset"
then
case $GCC in
yes)
if test "$CC" != 'g++' ; then
STRICT_PROTO="-Wstrict-prototypes"
fi
# For gcc 4.x we need to use -fwrapv so lets check if its supported
if "$CC" -v --help 2>/dev/null |grep -- -fwrapv > /dev/null; then
WRAP="-fwrapv"
@ -1470,8 +1467,6 @@ then
;;
esac
OPT="$OPT $STRICT_PROTO"
case $ac_sys_system in
SCO_SV*) OPT="$OPT -m486 -DSCO5"
;;
@ -1678,6 +1673,26 @@ yes)
fi
AC_MSG_RESULT($ac_cv_enable_unreachable_code_warning)
AC_MSG_CHECKING(if we can turn on $CC strict-prototypes warning)
ac_save_cc="$CC"
CC="$CC -Werror -Wstrict-prototypes"
AC_CACHE_VAL(ac_cv_enable_enable_strict_prototypes_warning,
AC_COMPILE_IFELSE(
[
AC_LANG_PROGRAM([[]], [[]])
],[
ac_cv_enable_strict_prototypes_warning=yes
],[
ac_cv_enable_strict_prototypes_warning=no
]))
CC="$ac_save_cc"
AC_MSG_RESULT($ac_cv_enable_strict_prototypes_warning)
if test $ac_cv_enable_strict_prototypes_warning = yes
then
CFLAGS_NODIST="$CFLAGS_NODIST -Wstrict-prototypes"
fi
AC_MSG_CHECKING(if we can make implicit function declaration an error in $CC)
ac_save_cc="$CC"
CC="$CC -Werror=implicit-function-declaration"