From 6757cf57697d30c73f4e3f314883ad2d8999eac6 Mon Sep 17 00:00:00 2001 From: Trevor Saunders Date: Sat, 19 Mar 2016 21:48:35 -0400 Subject: 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 * configure: Regenerate. gprof/ChangeLog: 2016-03-31 Trevor Saunders * configure: Regenerate. ld/ChangeLog: 2016-03-31 Trevor Saunders * configure: Regenerate. opcodes/ChangeLog: 2016-03-31 Trevor Saunders * configure: Regenerate. bfd/ChangeLog: 2016-03-31 Trevor Saunders * configure: Regenerate. * warning.m4: Add WARN_WRITE_STRINGS AC_SUBST. gold/ChangeLog: 2016-03-31 Trevor Saunders * configure: Regenerate. gas/ChangeLog: 2016-03-31 Trevor Saunders * Makefile.am: Add WARN_WRITE_STRINGS to WARN_CFLAGS. * Makefile.in: Regenerate. * configure: Likewise. --- gprof/configure | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'gprof') diff --git a/gprof/configure b/gprof/configure index 77bfe7f..5b8fbd7 100755 --- a/gprof/configure +++ b/gprof/configure @@ -602,6 +602,7 @@ ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS +WARN_WRITE_STRINGS NO_WERROR WARN_CFLAGS GENINSRC_NEVER_FALSE @@ -10897,7 +10898,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10900 "configure" +#line 10901 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11003,7 +11004,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11006 "configure" +#line 11007 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12128,6 +12129,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 : @@ -12193,6 +12208,7 @@ fi + ac_config_files="$ac_config_files Makefile po/Makefile.in:po/Make-in" cat >confcache <<\_ACEOF -- cgit v1.1