diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2018-06-05 17:12:06 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-05 17:12:06 -0700 |
commit | d6e789c402330905b1bd9103538d1027fcfb08a4 (patch) | |
tree | 50c7a2503483ee9a88bac98e8ef9f4749a48dd0f /configure.ac | |
parent | e135032ffa08ad66caea8205488e037da85d2bf8 (diff) | |
download | cpython-git-d6e789c402330905b1bd9103538d1027fcfb08a4.tar.gz |
bpo-5755: Move -Wstrict-prototypes to CFLAGS_NODIST (GH-7395)
(cherry picked from commit e33648484775fa533fc8f1e5cc45f60061d29d54)
Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac index bb89477ec3..c844eb105c 100644 --- a/configure.ac +++ b/configure.ac @@ -1458,9 +1458,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" @@ -1507,8 +1504,6 @@ then ;; esac - OPT="$OPT $STRICT_PROTO" - case $ac_sys_system in SCO_SV*) OPT="$OPT -m486 -DSCO5" ;; @@ -1735,6 +1730,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" |