summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorCharles-François Natali <cf.natali@gmail.com>2014-08-01 20:57:49 (GMT)
committerCharles-François Natali <cf.natali@gmail.com>2014-08-01 20:57:49 (GMT)
commit7f9cc9359bdbcc877b2a6f976c8e8bdbc714ce90 (patch)
tree1295d2f983a2590238cb0222c560f222aa14d923 /configure.ac
parent30575c73639468f1c5ab207ce37816eaa4827473 (diff)
downloadcpython-7f9cc9359bdbcc877b2a6f976c8e8bdbc714ce90.zip
cpython-7f9cc9359bdbcc877b2a6f976c8e8bdbc714ce90.tar.gz
cpython-7f9cc9359bdbcc877b2a6f976c8e8bdbc714ce90.tar.bz2
Issue #22110: Enable extra compilation warnings.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac46
1 files changed, 46 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 3e8c49c..f396984 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1234,6 +1234,52 @@ yes)
BASECFLAGS="$BASECFLAGS -Werror=declaration-after-statement"
fi
+ AC_MSG_CHECKING(if we can turn on $CC mixed sign comparison warning)
+ ac_save_cc="$CC"
+ CC="$CC -Wsign-compare"
+ save_CFLAGS="$CFLAGS"
+ AC_CACHE_VAL(ac_cv_enable_sign_compare_warning,
+ AC_COMPILE_IFELSE(
+ [
+ AC_LANG_PROGRAM([[]], [[]])
+ ],[
+ ac_cv_enable_sign_compare_warning=yes
+ ],[
+ ac_cv_enable_sign_compare_warning=no
+ ]))
+ CFLAGS="$save_CFLAGS"
+ CC="$ac_save_cc"
+ AC_MSG_RESULT($ac_cv_enable_sign_compare_warning)
+
+ if test $ac_cv_enable_sign_compare_warning = yes
+ then
+ BASECFLAGS="$BASECFLAGS -Wsign-compare"
+ fi
+
+ AC_MSG_CHECKING(if we can turn on $CC unreachable code warning)
+ ac_save_cc="$CC"
+ CC="$CC -Wunreachable-code"
+ save_CFLAGS="$CFLAGS"
+ AC_CACHE_VAL(ac_cv_enable_unreachable_code_warning,
+ AC_COMPILE_IFELSE(
+ [
+ AC_LANG_PROGRAM([[]], [[]])
+ ],[
+ ac_cv_enable_unreachable_code_warning=yes
+ ],[
+ ac_cv_enable_unreachable_code_warning=no
+ ]))
+ CFLAGS="$save_CFLAGS"
+ CC="$ac_save_cc"
+ AC_MSG_RESULT($ac_cv_enable_unreachable_code_warning)
+
+ # Don't enable unreachable code warning in debug mode, since it usually
+ # results in non-standard code paths.
+ if test $ac_cv_enable_unreachable_code_warning = yes && test "$Py_DEBUG" != "true"
+ then
+ BASECFLAGS="$BASECFLAGS -Wunreachable-code"
+ fi
+
# if using gcc on alpha, use -mieee to get (near) full IEEE 754
# support. Without this, treatment of subnormals doesn't follow
# the standard.