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.
This commit is contained in:
Trevor Saunders 2016-03-19 21:48:35 -04:00
parent e4a0c70877
commit 6757cf5769
10 changed files with 130 additions and 14 deletions

20
bfd/configure vendored
View File

@ -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"

View File

@ -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)
])

20
binutils/configure vendored
View File

@ -650,6 +650,7 @@ LEX_OUTPUT_ROOT
LEX
YFLAGS
YACC
WARN_WRITE_STRINGS
NO_WERROR
WARN_CFLAGS
OTOOL64
@ -11221,7 +11222,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 11224 "configure"
#line 11225 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -11327,7 +11328,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 11330 "configure"
#line 11331 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -11972,6 +11973,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 :
@ -12032,6 +12047,7 @@ fi
ac_config_headers="$ac_config_headers config.h:config.in"

View File

@ -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)

View File

@ -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@

20
gas/configure vendored
View File

@ -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"

16
gold/configure vendored
View File

@ -607,6 +607,7 @@ LFS_CFLAGS
GOLD_LDADD
GOLD_LDFLAGS
WARN_CXXFLAGS
WARN_WRITE_STRINGS
NO_WERROR
WARN_CFLAGS
IFUNC_STATIC_FALSE
@ -6718,6 +6719,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 :
@ -6778,6 +6793,7 @@ fi
WARN_CXXFLAGS=`echo ${WARN_CFLAGS} | sed -e 's/-Wstrict-prototypes//' -e 's/-Wmissing-prototypes//' -e 's/-Wshadow//'`

20
gprof/configure vendored
View File

@ -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

20
ld/configure vendored
View File

@ -644,6 +644,7 @@ INCINTL
LIBINTL_DEP
LIBINTL
USE_NLS
WARN_WRITE_STRINGS
NO_WERROR
WARN_CFLAGS
installed_linker
@ -11716,7 +11717,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 11719 "configure"
#line 11720 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -11822,7 +11823,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 11825 "configure"
#line 11826 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -15571,6 +15572,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 :
@ -15632,6 +15647,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LC_MESSAGES" >&5
$as_echo_n "checking for LC_MESSAGES... " >&6; }
if test "${am_cv_val_LC_MESSAGES+set}" = set; then :

20
opcodes/configure vendored
View File

@ -641,6 +641,7 @@ MAINT
MAINTAINER_MODE_FALSE
MAINTAINER_MODE_TRUE
NO_WMISSING_FIELD_INITIALIZERS
WARN_WRITE_STRINGS
NO_WERROR
WARN_CFLAGS
OTOOL64
@ -11146,7 +11147,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 11149 "configure"
#line 11150 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -11252,7 +11253,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 11255 "configure"
#line 11256 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -11535,6 +11536,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 :
@ -11594,6 +11609,7 @@ fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'