Skip to content

bpo-5755: Move -Wstrict-prototypes to CFLAGS_NODIST #7395

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Move ``-Wstrict-prototypes`` option to ``CFLAGS_NODIST`` from ``OPT``. This
option emitted annoying warnings when building extension modules written in
C++.
46 changes: 41 additions & 5 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -6676,9 +6676,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"
Expand Down Expand Up @@ -6725,8 +6722,6 @@ then
;;
esac

OPT="$OPT $STRICT_PROTO"

case $ac_sys_system in
SCO_SV*) OPT="$OPT -m486 -DSCO5"
;;
Expand Down Expand Up @@ -7094,6 +7089,47 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_unreachable_code_warning" >&5
$as_echo "$ac_cv_enable_unreachable_code_warning" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can turn on $CC strict-prototypes warning" >&5
$as_echo_n "checking if we can turn on $CC strict-prototypes warning... " >&6; }
ac_save_cc="$CC"
CC="$CC -Werror -Wstrict-prototypes"
if ${ac_cv_enable_enable_strict_prototypes_warning+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */


int
main ()
{

;
return 0;
}

_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :

ac_cv_enable_strict_prototypes_warning=yes

else

ac_cv_enable_strict_prototypes_warning=no

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi

CC="$ac_save_cc"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_strict_prototypes_warning" >&5
$as_echo "$ac_cv_enable_strict_prototypes_warning" >&6; }

if test $ac_cv_enable_strict_prototypes_warning = yes
then
CFLAGS_NODIST="$CFLAGS_NODIST -Wstrict-prototypes"
fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can make implicit function declaration an error in $CC" >&5
$as_echo_n "checking if we can make implicit function declaration an error in $CC... " >&6; }
ac_save_cc="$CC"
Expand Down
25 changes: 20 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -1470,8 +1467,6 @@ then
;;
esac

OPT="$OPT $STRICT_PROTO"

case $ac_sys_system in
SCO_SV*) OPT="$OPT -m486 -DSCO5"
;;
Expand Down Expand Up @@ -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"
Expand Down