diff options
author | Ned Deily <nad@python.org> | 2016-03-08 05:28:37 (GMT) |
---|---|---|
committer | Ned Deily <nad@python.org> | 2016-03-08 05:28:37 (GMT) |
commit | bec699e40d7e68d4039d2c1a352dcdb1661e77ef (patch) | |
tree | 153d940f81b33f143b91dee99336036a6680c65d /configure.ac | |
parent | adbf8cecbe11076a09f7997b5a72bd6e37908da8 (diff) | |
download | cpython-bec699e40d7e68d4039d2c1a352dcdb1661e77ef.zip cpython-bec699e40d7e68d4039d2c1a352dcdb1661e77ef.tar.gz cpython-bec699e40d7e68d4039d2c1a352dcdb1661e77ef.tar.bz2 |
Issue #24324: Do not enable unreachable code warnings when using
gcc as the option does not work correctly in older versions of gcc
and has been silently removed as of gcc-4.5.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index 94632f2..bacb7b0 100644 --- a/configure.ac +++ b/configure.ac @@ -1483,14 +1483,23 @@ yes) ])) 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" + # Issue #24324: Unfortunately, the unreachable code warning does not work + # correctly on gcc and has been silently removed from the compiler. + # It is supported on clang but on OS X systems gcc may be an alias + # for clang. Try to determine if the compiler is not really gcc and, + # if so, only then enable the warning. + if test $ac_cv_enable_unreachable_code_warning = yes && \ + test "$Py_DEBUG" != "true" && \ + test -z "`$CC --version 2>/dev/null | grep 'Free Software Foundation'`" then BASECFLAGS="$BASECFLAGS -Wunreachable-code" + else + ac_cv_enable_unreachable_code_warning=no fi + AC_MSG_RESULT($ac_cv_enable_unreachable_code_warning) # if using gcc on alpha, use -mieee to get (near) full IEEE 754 # support. Without this, treatment of subnormals doesn't follow |