From 9780e045073b1719a7a4c6cbe00e4aa7525bd180 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Tue, 22 Mar 2016 09:41:16 +0000 Subject: Add -Wstack-usage to the gcc warning flags list, but only if using a sufficiently recent version of gcc. bfd * warning.m4 (GCC_WARN_CFLAGS): Only add -Wstack-usage if using a sufficiently recent version of GCC. * configure: Regenerate. others * configure: Regenerate. --- gprof/ChangeLog | 4 ++++ gprof/configure | 20 +++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) (limited to 'gprof') diff --git a/gprof/ChangeLog b/gprof/ChangeLog index a23abcc445a..14b430d26a3 100644 --- a/gprof/ChangeLog +++ b/gprof/ChangeLog @@ -1,3 +1,7 @@ +2016-03-22 Nick Clifton + + * configure: Regenerate. + 2016-01-17 Alan Modra * configure: Regenerate. diff --git a/gprof/configure b/gprof/configure index 79813e0ec87..77bfe7febfb 100755 --- a/gprof/configure +++ b/gprof/configure @@ -12097,7 +12097,10 @@ fi # Set the 'development' global. . $srcdir/../bfd/development.sh +# Default set of GCC warnings to enable. GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" + +# Add -Wshadow if the compiler is a sufficiently recent version of GCC. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ __GNUC__ @@ -12111,6 +12114,21 @@ fi rm -f conftest* +# Add -Wstack-usage if the compiler is a sufficiently recent version of GCC. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +__GNUC__ +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "^[0-4]$" >/dev/null 2>&1; then : + +else + GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wstack-usage=262144" +fi +rm -f conftest* + + + # Check whether --enable-werror was given. if test "${enable_werror+set}" = set; then : enableval=$enable_werror; case "${enableval}" in @@ -12138,7 +12156,7 @@ fi NO_WERROR= if test "${ERROR_ON_WARNING}" = yes ; then - GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Werror -Wstack-usage=262144" + GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Werror" NO_WERROR="-Wno-error" fi -- cgit v1.2.1