* warning.m4 (GCC_WARN_CFLAGS): Only add -Wshadow for gcc-4 and above.
authorAlan Modra <amodra@gmail.com>
Wed, 7 Apr 2010 07:19:02 +0000 (07:19 +0000)
committerAlan Modra <amodra@gmail.com>
Wed, 7 Apr 2010 07:19:02 +0000 (07:19 +0000)
* configure: Regenerate.

bfd/ChangeLog
bfd/configure
bfd/warning.m4

index 1d4fecb8faffee8f4c1131f541dbfd242f2c45fc..a4548e02e8ace1df5dab8546b06c729c500af00e 100644 (file)
@@ -1,3 +1,8 @@
+2010-04-07  Alan Modra  <amodra@gmail.com>
+
+       * warning.m4 (GCC_WARN_CFLAGS): Only add -Wshadow for gcc-4 and above.
+       * configure: Regenerate.
+
 2010-04-06  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR ld/11434
index 0f73da3c25767773000ec61f32d67ae9db37cef7..f4aba27fea4dccc5d82036ed43bdfcc00b201682 100755 (executable)
 
 
 
-GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow"
+GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+__GNUC__
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "^[0-3]$" >/dev/null 2>&1; then :
+
+else
+  GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wshadow"
+fi
+rm -f conftest*
+
 
 # Check whether --enable-werror was given.
 if test "${enable_werror+set}" = set; then :
@@ -12140,7 +12152,7 @@ if test "${enable_werror+set}" = set; then :
 fi
 
 
-# Enable -Wno-format by default when using gcc on mingw
+# Disable -Wformat by default when using gcc on mingw
 case "${host}" in
   *-*-mingw32*)
     if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
index b4a2f48f8ba21fc337fca7c99d4233a0a2d50b91..6b846bf4ea32c953e259d4ebd6d875b890577db7 100644 (file)
@@ -1,7 +1,8 @@
 dnl Common configure.in fragment
 
 AC_DEFUN([AM_BINUTILS_WARNINGS],[
-GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow"
+GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
+AC_EGREP_CPP([^[0-3]$],[__GNUC__],,GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wshadow")
 
 AC_ARG_ENABLE(werror,
   [  --enable-werror         treat compile warnings as errors],
@@ -11,7 +12,7 @@ AC_ARG_ENABLE(werror,
      *) AC_MSG_ERROR(bad value ${enableval} for --enable-werror) ;;
    esac])
 
-# Enable -Wno-format by default when using gcc on mingw
+# Disable -Wformat by default when using gcc on mingw
 case "${host}" in
   *-*-mingw32*)
     if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
This page took 0.036614 seconds and 4 git commands to generate.