diff options
author | Trevor Saunders <tbsaunde+binutils@tbsaunde.org> | 2016-03-19 21:48:35 -0400 |
---|---|---|
committer | Trevor Saunders <tbsaunde+binutils@tbsaunde.org> | 2016-03-31 07:30:56 -0400 |
commit | 6757cf57697d30c73f4e3f314883ad2d8999eac6 (patch) | |
tree | ce9bd791ba49b4cb58f277209d52f7e7793edb13 /gas | |
parent | e4a0c708776681a6839c4335f999e45251e7b991 (diff) | |
download | gdb-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 'gas')
-rw-r--r-- | gas/Makefile.am | 2 | ||||
-rw-r--r-- | gas/Makefile.in | 2 | ||||
-rwxr-xr-x | gas/configure | 20 |
3 files changed, 20 insertions, 4 deletions
diff --git a/gas/Makefile.am b/gas/Makefile.am index 36ef7ed..596e469 100644 --- a/gas/Makefile.am +++ b/gas/Makefile.am @@ -37,7 +37,7 @@ LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo @LEX@ ; fi` am__skiplex = am__skipyacc = -WARN_CFLAGS = @WARN_CFLAGS@ +WARN_CFLAGS = @WARN_CFLAGS@ @WARN_WRITE_STRINGS@ NO_WERROR = @NO_WERROR@ AM_CFLAGS = $(WARN_CFLAGS) $(ZLIBINC) diff --git a/gas/Makefile.in b/gas/Makefile.in index c407d72..0d1065f 100644 --- a/gas/Makefile.in +++ b/gas/Makefile.in @@ -232,7 +232,7 @@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ -WARN_CFLAGS = @WARN_CFLAGS@ +WARN_CFLAGS = @WARN_CFLAGS@ @WARN_WRITE_STRINGS@ XGETTEXT = @XGETTEXT@ YACC = `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison ; else echo @YACC@ ; fi` YFLAGS = @YFLAGS@ diff --git a/gas/configure b/gas/configure index 11e6ed4..131dd2d 100755 --- a/gas/configure +++ b/gas/configure @@ -640,6 +640,7 @@ target_cpu_type extra_objects cgen_cpu_prefix GDBINIT +WARN_WRITE_STRINGS NO_WERROR WARN_CFLAGS OTOOL64 @@ -10978,7 +10979,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10981 "configure" +#line 10982 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11084,7 +11085,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11087 "configure" +#line 11088 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11745,6 +11746,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 : @@ -11805,6 +11820,7 @@ fi + # Generate a header file ac_config_headers="$ac_config_headers config.h:config.in" |