Skip to content

Commit bec699e

Browse files
committed
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.
1 parent adbf8ce commit bec699e

File tree

4 files changed

+29
-7
lines changed

4 files changed

+29
-7
lines changed

Misc/NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,10 @@ Build
310310

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

313+
- Issue #24324: Do not enable unreachable code warnings when using
314+
gcc as the option does not work correctly in older versions of gcc
315+
and has been silently removed as of gcc-4.5.
316+
313317
Windows
314318
-------
315319

aclocal.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
1+
# generated automatically by aclocal 1.15 -*- Autoconf -*-
22

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

55
# This file is free software; the Free Software Foundation
66
# gives unlimited permission to copy and/or distribute it,

configure

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6963,15 +6963,24 @@ fi
69636963

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

69696967
# Don't enable unreachable code warning in debug mode, since it usually
69706968
# results in non-standard code paths.
6971-
if test $ac_cv_enable_unreachable_code_warning = yes && test "$Py_DEBUG" != "true"
6969+
# Issue #24324: Unfortunately, the unreachable code warning does not work
6970+
# correctly on gcc and has been silently removed from the compiler.
6971+
# It is supported on clang but on OS X systems gcc may be an alias
6972+
# for clang. Try to determine if the compiler is not really gcc and,
6973+
# if so, only then enable the warning.
6974+
if test $ac_cv_enable_unreachable_code_warning = yes && \
6975+
test "$Py_DEBUG" != "true" && \
6976+
test -z "`$CC --version 2>/dev/null | grep 'Free Software Foundation'`"
69726977
then
69736978
BASECFLAGS="$BASECFLAGS -Wunreachable-code"
6979+
else
6980+
ac_cv_enable_unreachable_code_warning=no
69746981
fi
6982+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_unreachable_code_warning" >&5
6983+
$as_echo "$ac_cv_enable_unreachable_code_warning" >&6; }
69756984

69766985
# if using gcc on alpha, use -mieee to get (near) full IEEE 754
69776986
# support. Without this, treatment of subnormals doesn't follow

configure.ac

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1483,14 +1483,23 @@ yes)
14831483
]))
14841484
CFLAGS="$save_CFLAGS"
14851485
CC="$ac_save_cc"
1486-
AC_MSG_RESULT($ac_cv_enable_unreachable_code_warning)
14871486

14881487
# Don't enable unreachable code warning in debug mode, since it usually
14891488
# results in non-standard code paths.
1490-
if test $ac_cv_enable_unreachable_code_warning = yes && test "$Py_DEBUG" != "true"
1489+
# Issue #24324: Unfortunately, the unreachable code warning does not work
1490+
# correctly on gcc and has been silently removed from the compiler.
1491+
# It is supported on clang but on OS X systems gcc may be an alias
1492+
# for clang. Try to determine if the compiler is not really gcc and,
1493+
# if so, only then enable the warning.
1494+
if test $ac_cv_enable_unreachable_code_warning = yes && \
1495+
test "$Py_DEBUG" != "true" && \
1496+
test -z "`$CC --version 2>/dev/null | grep 'Free Software Foundation'`"
14911497
then
14921498
BASECFLAGS="$BASECFLAGS -Wunreachable-code"
1499+
else
1500+
ac_cv_enable_unreachable_code_warning=no
14931501
fi
1502+
AC_MSG_RESULT($ac_cv_enable_unreachable_code_warning)
14941503

14951504
# if using gcc on alpha, use -mieee to get (near) full IEEE 754
14961505
# support. Without this, treatment of subnormals doesn't follow

0 commit comments

Comments
 (0)