From 3107326d3df950b0578a895bb835b2a8dfa8fab7 Mon Sep 17 00:00:00 2001 From: Andrew Paprocki Date: Wed, 9 Jan 2019 13:51:08 +1030 Subject: Adjust bfd/warning.m4 egrep patterns Adjust the `bfd/warning.m4` `egrep` patterns to handle preprocessors that do not define `__GNUC__`, leaving the string in the output. bfd/ * warning.m4: Adjust egrep pattern for non-GNU compilers. * configure: Regenerate. binutils/ * configure: Regenerate. gas/ * configure: Regenerate. gold/ * configure: Regenerate. gprof/ * configure: Regenerate. ld/ * configure: Regenerate. opcodes/ * configure: Regenerate. --- bfd/warning.m4 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'bfd/warning.m4') diff --git a/bfd/warning.m4 b/bfd/warning.m4 index 50f400bdf97..8b0a3427bc7 100644 --- a/bfd/warning.m4 +++ b/bfd/warning.m4 @@ -47,22 +47,22 @@ GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" GCC_WARN_CFLAGS_FOR_BUILD="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" # Add -Wshadow if the compiler is a sufficiently recent version of GCC. -AC_EGREP_CPP([^[0-3]$],[__GNUC__],,GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wshadow") +AC_EGREP_CPP([(^[0-3]$|^__GNUC__$)],[__GNUC__],,GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wshadow") # Add -Wstack-usage if the compiler is a sufficiently recent version of GCC. -AC_EGREP_CPP([^[0-4]$],[__GNUC__],,GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wstack-usage=262144") +AC_EGREP_CPP([(^[0-4]$|^__GNUC__$)],[__GNUC__],,GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wstack-usage=262144") # Set WARN_WRITE_STRINGS if the compiler supports -Wwrite-strings. WARN_WRITE_STRINGS="" -AC_EGREP_CPP([^[0-3]$],[__GNUC__],,WARN_WRITE_STRINGS="-Wwrite-strings") +AC_EGREP_CPP([(^[0-3]$|^__GNUC__$)],[__GNUC__],,WARN_WRITE_STRINGS="-Wwrite-strings") # Verify CC_FOR_BUILD to be compatible with warning flags # Add -Wshadow if the compiler is a sufficiently recent version of GCC. -AC_EGREP_CPP_FOR_BUILD([^[0-3]$],[__GNUC__],,GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wshadow") +AC_EGREP_CPP_FOR_BUILD([(^[0-3]$|^__GNUC__$)],[__GNUC__],,GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wshadow") # Add -Wstack-usage if the compiler is a sufficiently recent version of GCC. -AC_EGREP_CPP_FOR_BUILD([^[0-4]$],[__GNUC__],,GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wstack-usage=262144") +AC_EGREP_CPP_FOR_BUILD([(^[0-4]$|^__GNUC__$)],[__GNUC__],,GCC_WARN_CFLAGS_FOR_BUILD="$GCC_WARN_CFLAGS_FOR_BUILD -Wstack-usage=262144") AC_ARG_ENABLE(werror, [ --enable-werror treat compile warnings as errors], -- cgit v1.2.1