aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorTrevor Saunders <tbsaunde+binutils@tbsaunde.org>2016-03-19 21:48:35 -0400
committerTrevor Saunders <tbsaunde+binutils@tbsaunde.org>2016-03-31 07:30:56 -0400
commit6757cf57697d30c73f4e3f314883ad2d8999eac6 (patch)
treece9bd791ba49b4cb58f277209d52f7e7793edb13 /bfd
parente4a0c708776681a6839c4335f999e45251e7b991 (diff)
downloadgdb-6757cf57697d30c73f4e3f314883ad2d8999eac6.zip
gdb-6757cf57697d30c73f4e3f314883ad2d8999eac6.tar.gz
gdb-6757cf57697d30c73f4e3f314883ad2d8999eac6.tar.bz2
enable -Wwrite-strings for gas
We add a new AC_SUBST to warning.m4 so that the test if the warning is supported is centralized, but the warning can be enabled per directory. binutils/ChangeLog: 2016-03-31 Trevor Saunders <tbsaunde+binutils@tbsaunde.org> * configure: Regenerate. gprof/ChangeLog: 2016-03-31 Trevor Saunders <tbsaunde+binutils@tbsaunde.org> * configure: Regenerate. ld/ChangeLog: 2016-03-31 Trevor Saunders <tbsaunde+binutils@tbsaunde.org> * configure: Regenerate. opcodes/ChangeLog: 2016-03-31 Trevor Saunders <tbsaunde+binutils@tbsaunde.org> * configure: Regenerate. bfd/ChangeLog: 2016-03-31 Trevor Saunders <tbsaunde+binutils@tbsaunde.org> * configure: Regenerate. * warning.m4: Add WARN_WRITE_STRINGS AC_SUBST. gold/ChangeLog: 2016-03-31 Trevor Saunders <tbsaunde+binutils@tbsaunde.org> * configure: Regenerate. gas/ChangeLog: 2016-03-31 Trevor Saunders <tbsaunde+binutils@tbsaunde.org> * Makefile.am: Add WARN_WRITE_STRINGS to WARN_CFLAGS. * Makefile.in: Regenerate. * configure: Likewise.
Diffstat (limited to 'bfd')
-rwxr-xr-xbfd/configure20
-rw-r--r--bfd/warning.m44
2 files changed, 22 insertions, 2 deletions
diff --git a/bfd/configure b/bfd/configure
index d03b996..51581ba 100755
--- a/bfd/configure
+++ b/bfd/configure
@@ -657,6 +657,7 @@ GENINSRC_NEVER_TRUE
MAINT
MAINTAINER_MODE_FALSE
MAINTAINER_MODE_TRUE
+WARN_WRITE_STRINGS
NO_WERROR
WARN_CFLAGS
REPORT_BUGS_TEXI
@@ -11421,7 +11422,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11424 "configure"
+#line 11425 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11527,7 +11528,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11530 "configure"
+#line 11531 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -12254,6 +12255,20 @@ fi
rm -f conftest*
+# Set WARN_WRITE_STRINGS if the compiler supports -Wwrite-strings.
+WARN_WRITE_STRINGS=""
+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
+ WARN_WRITE_STRINGS="-Wwrite-strings"
+fi
+rm -f conftest*
+
# Check whether --enable-werror was given.
if test "${enable_werror+set}" = set; then :
@@ -12314,6 +12329,7 @@ fi
+
ac_config_headers="$ac_config_headers config.h:config.in"
diff --git a/bfd/warning.m4 b/bfd/warning.m4
index 028d079..4c5b55d 100644
--- a/bfd/warning.m4
+++ b/bfd/warning.m4
@@ -30,6 +30,9 @@ AC_EGREP_CPP([^[0-3]$],[__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")
+# 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_ARG_ENABLE(werror,
[ --enable-werror treat compile warnings as errors],
@@ -84,4 +87,5 @@ fi
AC_SUBST(WARN_CFLAGS)
AC_SUBST(NO_WERROR)
+ AC_SUBST(WARN_WRITE_STRINGS)
])