Skip to content

Commit

Permalink
Issue python#24324: Do not enable unreachable code warnings when using
Browse files Browse the repository at this point in the history
gcc as the option does not work correctly in older versions of gcc
and has been silently removed as of gcc-4.5.
  • Loading branch information
ned-deily committed Mar 8, 2016
1 parent adbf8ce commit bec699e
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 7 deletions.
4 changes: 4 additions & 0 deletions Misc/NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,10 @@ Build

- Issue #25136: Support Apple Xcode 7's new textual SDK stub libraries.

- 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.

Windows
-------

Expand Down
4 changes: 2 additions & 2 deletions aclocal.m4
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
# generated automatically by aclocal 1.15 -*- Autoconf -*-

# Copyright (C) 1996-2013 Free Software Foundation, Inc.
# Copyright (C) 1996-2014 Free Software Foundation, Inc.

# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
Expand Down
15 changes: 12 additions & 3 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -6963,15 +6963,24 @@ fi

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

# 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
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_unreachable_code_warning" >&5
$as_echo "$ac_cv_enable_unreachable_code_warning" >&6; }

# if using gcc on alpha, use -mieee to get (near) full IEEE 754
# support. Without this, treatment of subnormals doesn't follow
Expand Down
13 changes: 11 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bec699e

Please sign in to comment.