aboutsummaryrefslogtreecommitdiff
path: root/bfd/warning.m4
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/warning.m4
parente4a0c708776681a6839c4335f999e45251e7b991 (diff)
downloadfsf-binutils-gdb-6757cf57697d30c73f4e3f314883ad2d8999eac6.zip
fsf-binutils-gdb-6757cf57697d30c73f4e3f314883ad2d8999eac6.tar.gz
fsf-binutils-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/warning.m4')
-rw-r--r--bfd/warning.m44
1 files changed, 4 insertions, 0 deletions
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)
])