public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 3/7] cast to char * when assigning to optarg
  2016-03-30  1:08 [PATCH 0/7] enable -Wwrite-strings for gas tbsaunde+binutils
  2016-03-30  1:08 ` [PATCH 1/7] cast literal to char * when assigning to input_line_ptr tbsaunde+binutils
  2016-03-30  1:08 ` [PATCH 2/7] work around get_symbol_name () in sparc and ia64 tbsaunde+binutils
@ 2016-03-30  1:08 ` tbsaunde+binutils
  2016-03-30  1:08 ` [PATCH 5/7] tc-i960.c: add some casts when assigning literals to args[i] tbsaunde+binutils
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 17+ messages in thread
From: tbsaunde+binutils @ 2016-03-30  1:08 UTC (permalink / raw)
  To: binutils; +Cc: Trevor Saunders

From: Trevor Saunders <tbsaunde+binutils@tbsaunde.org>

gas/ChangeLog:

2016-03-29  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* as.c (parse_args): Cast literal to char * when assigning to optarg.
---
 gas/as.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gas/as.c b/gas/as.c
index ad3d3a6..cf8e90d 100644
--- a/gas/as.c
+++ b/gas/as.c
@@ -621,7 +621,7 @@ parse_args (int * pargc, char *** pargv)
 
 	case 1:			/* File name.  */
 	  if (!strcmp (optarg, "-"))
-	    optarg = "";
+	    optarg = (char *) "";
 	  new_argv[new_argc++] = optarg;
 	  new_argv[new_argc] = NULL;
 	  break;
-- 
2.1.4

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 0/7] enable -Wwrite-strings for gas
@ 2016-03-30  1:08 tbsaunde+binutils
  2016-03-30  1:08 ` [PATCH 1/7] cast literal to char * when assigning to input_line_ptr tbsaunde+binutils
                   ` (8 more replies)
  0 siblings, 9 replies; 17+ messages in thread
From: tbsaunde+binutils @ 2016-03-30  1:08 UTC (permalink / raw)
  To: binutils; +Cc: Trevor Saunders

From: Trevor Saunders <tbsaunde+binutils@tbsaunde.org>

Hi,

At this point I think we've fixed basically all the -Wwrite-strings issues in
gas that can be fixed reasonably without just adding casts.  So this series
adds a handful of casts in several patches that try to explain why those casts
are necessary, and then enables the warning for gas.

I built one target per tc-*.c and regtested x86_64-linux-gnu, ok?

Trev


Trevor Saunders (7):
  cast literal to char * when assigning to input_line_ptr
  work around get_symbol_name () in sparc and ia64
  cast to char * when assigning to optarg
  cast the arg to md_assemble () to char *
  tc-i960.c: add some casts when assigning literals to args[i]
  make xtensa_section_rename () take const char *
  enable -Wwrite-strings for gas

 bfd/configure          | 20 ++++++++++++++++++--
 bfd/warning.m4         |  4 ++++
 binutils/configure     | 20 ++++++++++++++++++--
 gas/Makefile.am        |  2 +-
 gas/Makefile.in        |  2 +-
 gas/as.c               |  2 +-
 gas/config/tc-i960.c   | 26 +++++++++++++-------------
 gas/config/tc-ia64.c   |  6 ++++--
 gas/config/tc-m32c.c   |  8 ++++----
 gas/config/tc-m32r.c   |  2 +-
 gas/config/tc-msp430.c |  2 +-
 gas/config/tc-nds32.c  | 10 +++++-----
 gas/config/tc-sparc.c  |  2 +-
 gas/config/tc-xtensa.c |  6 +++---
 gas/config/tc-xtensa.h |  2 +-
 gas/config/tc-z80.c    |  2 +-
 gas/configure          | 20 ++++++++++++++++++--
 gas/stabs.c            |  2 +-
 gold/configure         | 16 ++++++++++++++++
 gprof/configure        | 20 ++++++++++++++++++--
 ld/configure           | 20 ++++++++++++++++++--
 opcodes/configure      | 20 ++++++++++++++++++--
 22 files changed, 166 insertions(+), 48 deletions(-)

-- 
2.1.4

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 5/7] tc-i960.c: add some casts when assigning literals to args[i]
  2016-03-30  1:08 [PATCH 0/7] enable -Wwrite-strings for gas tbsaunde+binutils
                   ` (2 preceding siblings ...)
  2016-03-30  1:08 ` [PATCH 3/7] cast to char * when assigning to optarg tbsaunde+binutils
@ 2016-03-30  1:08 ` tbsaunde+binutils
  2016-03-30  1:08 ` [PATCH 7/7] enable -Wwrite-strings for gas tbsaunde+binutils
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 17+ messages in thread
From: tbsaunde+binutils @ 2016-03-30  1:08 UTC (permalink / raw)
  To: binutils; +Cc: Trevor Saunders

From: Trevor Saunders <tbsaunde+binutils@tbsaunde.org>

parse_ldconst () takes a char ** as a in / out argument, and sometimes points
args[0] to a constant string.  Then in some cases after parse_ldconst ()
     returns md_assemble () twiddles the contents of arg[0].  So it seems like
     it would take some work to avoid these casts, and its not really clear
     that work is worth it.

gas/ChangeLog:

2016-03-29  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* config/tc-i960.c (parse_ldconst): Cast to char * when assigning to
	args[0].
---
 gas/config/tc-i960.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/gas/config/tc-i960.c b/gas/config/tc-i960.c
index 45e8a44..667ab4c 100644
--- a/gas/config/tc-i960.c
+++ b/gas/config/tc-i960.c
@@ -1246,7 +1246,7 @@ parse_ldconst (char *arg[])	/* See above.  */
     {
     default:
       /* We're dependent on one or more symbols -- use "lda".  */
-      arg[0] = "lda";
+      arg[0] = (char *) "lda";
       break;
 
     case O_constant:
@@ -1263,26 +1263,26 @@ parse_ldconst (char *arg[])	/* See above.  */
                 lda xxx,<reg>.  */
       n = offs (e);
       if ((0 <= n) && (n <= 31))
-	arg[0] = "mov";
+	arg[0] = (char *) "mov";
       else if ((-31 <= n) && (n <= -1))
 	{
-	  arg[0] = "subo";
+	  arg[0] = (char *) "subo";
 	  arg[3] = arg[2];
 	  sprintf (buf, "%d", -n);
 	  arg[1] = buf;
-	  arg[2] = "0";
+	  arg[2] = (char *) "0";
 	}
       else if ((32 <= n) && (n <= 62))
 	{
-	  arg[0] = "addo";
+	  arg[0] = (char *) "addo";
 	  arg[3] = arg[2];
-	  arg[1] = "31";
+	  arg[1] = (char *) "31";
 	  sprintf (buf, "%d", n - 31);
 	  arg[2] = buf;
 	}
       else if ((shift = shift_ok (n)) != 0)
 	{
-	  arg[0] = "shlo";
+	  arg[0] = (char *) "shlo";
 	  arg[3] = arg[2];
 	  sprintf (buf, "%d", shift);
 	  arg[1] = buf;
@@ -1290,7 +1290,7 @@ parse_ldconst (char *arg[])	/* See above.  */
 	  arg[2] = buf2;
 	}
       else
-	arg[0] = "lda";
+	arg[0] = (char *) "lda";
       break;
 
     case O_illegal:
-- 
2.1.4

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 7/7] enable -Wwrite-strings for gas
  2016-03-30  1:08 [PATCH 0/7] enable -Wwrite-strings for gas tbsaunde+binutils
                   ` (3 preceding siblings ...)
  2016-03-30  1:08 ` [PATCH 5/7] tc-i960.c: add some casts when assigning literals to args[i] tbsaunde+binutils
@ 2016-03-30  1:08 ` tbsaunde+binutils
  2016-04-01 11:22   ` Jiong Wang
  2016-03-30  1:14 ` [PATCH 6/7] make xtensa_section_rename () take const char * tbsaunde+binutils
                   ` (3 subsequent siblings)
  8 siblings, 1 reply; 17+ messages in thread
From: tbsaunde+binutils @ 2016-03-30  1:08 UTC (permalink / raw)
  To: binutils; +Cc: Trevor Saunders

From: Trevor Saunders <tbsaunde+binutils@tbsaunde.org>

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-29  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* configure: Regenerate.

gprof/ChangeLog:

2016-03-29  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* configure: Regenerate.

ld/ChangeLog:

2016-03-29  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* configure: Regenerate.

opcodes/ChangeLog:

2016-03-29  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* configure: Regenerate.

bfd/ChangeLog:

2016-03-29  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* configure: Regenerate.
	* warning.m4: Add WARN_WRITE_STRINGS AC_SUBST.

gold/ChangeLog:

2016-03-29  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* configure: Regenerate.

gas/ChangeLog:

2016-03-29  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* Makefile.am: Add WARN_WRITE_STRINGS to WARN_CFLAGS.
	* Makefile.in: Regenerate.
	* configure: Likewise.
---
 bfd/configure      | 20 ++++++++++++++++++--
 bfd/warning.m4     |  4 ++++
 binutils/configure | 20 ++++++++++++++++++--
 gas/Makefile.am    |  2 +-
 gas/Makefile.in    |  2 +-
 gas/configure      | 20 ++++++++++++++++++--
 gold/configure     | 16 ++++++++++++++++
 gprof/configure    | 20 ++++++++++++++++++--
 ld/configure       | 20 ++++++++++++++++++--
 opcodes/configure  | 20 ++++++++++++++++++--
 10 files changed, 130 insertions(+), 14 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)
 ])
diff --git a/binutils/configure b/binutils/configure
index 6ff4708..0e88476 100755
--- a/binutils/configure
+++ b/binutils/configure
@@ -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"
 
 
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"
 
diff --git a/gold/configure b/gold/configure
index 7fe771c..d0cfc95 100755
--- a/gold/configure
+++ b/gold/configure
@@ -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//'`
 
 
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
diff --git a/ld/configure b/ld/configure
index 572faa7..24f9316 100755
--- a/ld/configure
+++ b/ld/configure
@@ -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 :
diff --git a/opcodes/configure b/opcodes/configure
index da03f50..747c939 100755
--- a/opcodes/configure
+++ b/opcodes/configure
@@ -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'
-- 
2.1.4

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 1/7] cast literal to char * when assigning to input_line_ptr
  2016-03-30  1:08 [PATCH 0/7] enable -Wwrite-strings for gas tbsaunde+binutils
@ 2016-03-30  1:08 ` tbsaunde+binutils
  2016-03-30  1:08 ` [PATCH 2/7] work around get_symbol_name () in sparc and ia64 tbsaunde+binutils
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 17+ messages in thread
From: tbsaunde+binutils @ 2016-03-30  1:08 UTC (permalink / raw)
  To: binutils; +Cc: Trevor Saunders

From: Trevor Saunders <tbsaunde+binutils@tbsaunde.org>

various places either directly or indirectly set input_line_pointer to point at
a literal.  Currently lots of places modify the string input_line_pointer
points at, so making it const isn't easy.  Since most if not all of these
places assign to input_line_pointer to parse an expression it would probably be
best to add ways to generate and deal with expressions that doesn't involve
parsing strings, but for now adding some casts seems easiest.

gas/ChangeLog:

2016-03-29  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* config/tc-i960.c (parse_expr): Cast to char * when assigning to
	input_line_pointer.
	* config/tc-m32r.c (expand_debug_syms): Likewise.
	* config/tc-msp430.c (msp430_dstoperand): Likewise.
	* config/tc-z80.c (md_begin): Likewise.
	* stabs.c (stabs_generate_asm_func): Likewise.
---
 gas/config/tc-i960.c   | 10 +++++-----
 gas/config/tc-m32r.c   |  2 +-
 gas/config/tc-msp430.c |  2 +-
 gas/config/tc-z80.c    |  2 +-
 gas/stabs.c            |  2 +-
 5 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/gas/config/tc-i960.c b/gas/config/tc-i960.c
index 8a8f31c..45e8a44 100644
--- a/gas/config/tc-i960.c
+++ b/gas/config/tc-i960.c
@@ -450,7 +450,7 @@ static int br_cnt;
 /* Name of the table of pointers to branches.  A local (i.e.,
    non-external) symbol.  */
 
-static void ctrl_fmt (char *, long, int);
+static void ctrl_fmt (const char *, long, int);
 
 \f
 void
@@ -495,7 +495,7 @@ md_begin (void)
    string is not consumed in the evaluation -- tolerate no dangling junk!  */
 
 static void
-parse_expr (char *textP,		/* Text of expression to be parsed.  */
+parse_expr (const char *textP,		/* Text of expression to be parsed.  */
 	    expressionS *expP)		/* Where to put the results of parsing.  */
 {
   char *save_in;		/* Save global here.  */
@@ -513,7 +513,7 @@ parse_expr (char *textP,		/* Text of expression to be parsed.  */
   else
     {
       save_in = input_line_pointer;	/* Save global.  */
-      input_line_pointer = textP;	/* Make parser work for us.  */
+      input_line_pointer = (char *) textP;	/* Make parser work for us.  */
 
       (void) expression (expP);
       if ((size_t) (input_line_pointer - textP) != strlen (textP))
@@ -558,7 +558,7 @@ emit (long instr)		/* Word to be output, host byte order.  */
   		address displacement is greater than 13 bits.  */
 
 static void
-get_cdisp (char *dispP, /* Displacement as specified in source instruction.  */
+get_cdisp (const char *dispP, /* Displacement as specified in source instruction.  */
 	   const char *ifmtP, /* "COBR" or "CTRL" (for use in error message).  */
 	   long instr,  /* Instruction needing the displacement.  */
 	   int numbits, /* # bits of displacement (13 for COBR, 24 for CTRL).  */
@@ -1494,7 +1494,7 @@ brlab_next (void)
 }
 
 static void
-ctrl_fmt (char *targP,		/* Pointer to text of lone operand (if any).  */
+ctrl_fmt (const char *targP,		/* Pointer to text of lone operand (if any).  */
 	  long opcode,		/* Template of instruction.  */
 	  int num_ops)		/* Number of operands.  */
 {
diff --git a/gas/config/tc-m32r.c b/gas/config/tc-m32r.c
index 7621832..89205f8 100644
--- a/gas/config/tc-m32r.c
+++ b/gas/config/tc-m32r.c
@@ -613,7 +613,7 @@ expand_debug_syms (sym_linkS *syms, int align)
     {
       symbolS *symbolP = syms->symbol;
       next_syms = syms->next;
-      input_line_pointer = ".\n";
+      input_line_pointer = (char *) ".\n";
       pseudo_set (symbolP);
       free ((char *) syms);
     }
diff --git a/gas/config/tc-msp430.c b/gas/config/tc-msp430.c
index ae28984..98910aa 100644
--- a/gas/config/tc-msp430.c
+++ b/gas/config/tc-msp430.c
@@ -2156,7 +2156,7 @@ msp430_dstoperand (struct msp430_operand_s * op,
 
   if (op->am == 2)
     {
-      char *__tl = "0";
+      char *__tl = (char *) "0";
 
       op->mode = OP_EXP;
       op->am = 1;
diff --git a/gas/config/tc-z80.c b/gas/config/tc-z80.c
index 094b8e6..535ae22 100644
--- a/gas/config/tc-z80.c
+++ b/gas/config/tc-z80.c
@@ -249,7 +249,7 @@ md_begin (void)
         }
     }
   p = input_line_pointer;
-  input_line_pointer = "0";
+  input_line_pointer = (char *) "0";
   nul.X_md=0;
   expression (& nul);
   input_line_pointer = p;
diff --git a/gas/stabs.c b/gas/stabs.c
index 8d54f73..bc983c9 100644
--- a/gas/stabs.c
+++ b/gas/stabs.c
@@ -666,7 +666,7 @@ stabs_generate_asm_func (const char *funcname, const char *startlabname)
 
   if (! void_emitted_p)
     {
-      input_line_pointer = "\"void:t1=1\",128,0,0,0";
+      input_line_pointer = (char *) "\"void:t1=1\",128,0,0,0";
       s_stab ('s');
       void_emitted_p = 1;
     }
-- 
2.1.4

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 2/7] work around get_symbol_name () in sparc and ia64
  2016-03-30  1:08 [PATCH 0/7] enable -Wwrite-strings for gas tbsaunde+binutils
  2016-03-30  1:08 ` [PATCH 1/7] cast literal to char * when assigning to input_line_ptr tbsaunde+binutils
@ 2016-03-30  1:08 ` tbsaunde+binutils
  2016-03-30  1:08 ` [PATCH 3/7] cast to char * when assigning to optarg tbsaunde+binutils
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 17+ messages in thread
From: tbsaunde+binutils @ 2016-03-30  1:08 UTC (permalink / raw)
  To: binutils; +Cc: Trevor Saunders

From: Trevor Saunders <tbsaunde+binutils@tbsaunde.org>

get_symbol_name () returns a char * in a out arg, which means we need to cast
to assign a literal to the variable passed to get_symbol_name ().  It seems
like better APIs than get_symbol_name () could be provided, but that seems like
a fair amount of work so just casting seems to be the betterthing to do for
now.

gas/ChangeLog:

2016-03-29  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* config/tc-ia64.c (md_assemble): Add temporary variable to pass to
	get_symbol_name ().
	* config/tc-sparc.c (s_register): Cast a literal to char * in
	assignment.
---
 gas/config/tc-ia64.c  | 6 ++++--
 gas/config/tc-sparc.c | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/gas/config/tc-ia64.c b/gas/config/tc-ia64.c
index 85f6095..a50b61e 100644
--- a/gas/config/tc-ia64.c
+++ b/gas/config/tc-ia64.c
@@ -10667,7 +10667,8 @@ check_dv (struct ia64_opcode *idesc)
 void
 md_assemble (char *str)
 {
-  char *saved_input_line_pointer, *mnemonic;
+  char *saved_input_line_pointer, *temp;
+  const char *mnemonic;
   const struct pseudo_opcode *pdesc;
   struct ia64_opcode *idesc;
   unsigned char qp_regno;
@@ -10679,7 +10680,8 @@ md_assemble (char *str)
 
   /* extract the opcode (mnemonic):  */
 
-  ch = get_symbol_name (&mnemonic);
+  ch = get_symbol_name (&temp);
+  mnemonic = temp;
   pdesc = (struct pseudo_opcode *) hash_find (md.pseudo_hash, mnemonic);
   if (pdesc)
     {
diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c
index 6f2de4d..9f30d3a 100644
--- a/gas/config/tc-sparc.c
+++ b/gas/config/tc-sparc.c
@@ -4413,7 +4413,7 @@ s_register (int ignore ATTRIBUTE_UNUSED)
       if (regname[0] == 'i')
 	regname = NULL;
       else
-	regname = "";
+	regname = (char *) "";
     }
   else
     {
-- 
2.1.4

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 6/7] make xtensa_section_rename () take const char *
  2016-03-30  1:08 [PATCH 0/7] enable -Wwrite-strings for gas tbsaunde+binutils
                   ` (4 preceding siblings ...)
  2016-03-30  1:08 ` [PATCH 7/7] enable -Wwrite-strings for gas tbsaunde+binutils
@ 2016-03-30  1:14 ` tbsaunde+binutils
  2016-03-30  1:14 ` [PATCH 4/7] cast the arg to md_assemble () to " tbsaunde+binutils
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 17+ messages in thread
From: tbsaunde+binutils @ 2016-03-30  1:14 UTC (permalink / raw)
  To: binutils; +Cc: Trevor Saunders

From: Trevor Saunders <tbsaunde+binutils@tbsaunde.org>

Xtensa uses it in several macros passing it a literal string, so its convenient
for the argument type to be const char *.  However some of the code in
symbols.c seems to assume tc_canonicalize_symbol_name () will return a non
const pointer, and some other target's implementations even modify the
argument, so it seems best to return a char * which means casting away const on
the argument when we return it instead of another string.

gas/ChangeLog:

2016-03-29  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* config/tc-xtensa.c (struct rename_section_struct): Make old_name
	const.
	(xtensa_section_rename): Make argument type const char *.
	* config/tc-xtensa.h (xtensa_section_rename): Adjust.
---
 gas/config/tc-xtensa.c | 6 +++---
 gas/config/tc-xtensa.h | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c
index 3025d29..a74f689 100644
--- a/gas/config/tc-xtensa.c
+++ b/gas/config/tc-xtensa.c
@@ -13117,7 +13117,7 @@ copy_expr (expressionS *dst, const expressionS *src)
 
 struct rename_section_struct
 {
-  char *old_name;
+  const char *old_name;
   char *new_name;
   struct rename_section_struct *next;
 };
@@ -13190,7 +13190,7 @@ build_section_rename (const char *arg)
 
 
 char *
-xtensa_section_rename (char *name)
+xtensa_section_rename (const char *name)
 {
   struct rename_section_struct *r = section_rename;
 
@@ -13200,5 +13200,5 @@ xtensa_section_rename (char *name)
 	return r->new_name;
     }
 
-  return name;
+  return (char *) name;
 }
diff --git a/gas/config/tc-xtensa.h b/gas/config/tc-xtensa.h
index c8a5029..2c7b16e 100644
--- a/gas/config/tc-xtensa.h
+++ b/gas/config/tc-xtensa.h
@@ -333,7 +333,7 @@ extern void xtensa_elf_section_change_hook (void);
 extern int xtensa_unrecognized_line (int);
 extern bfd_boolean xtensa_check_inside_bundle (void);
 extern void xtensa_handle_align (fragS *);
-extern char *xtensa_section_rename (char *);
+extern char *xtensa_section_rename (const char *);
 
 #define TARGET_FORMAT			xtensa_target_format ()
 #define TARGET_ARCH			bfd_arch_xtensa
-- 
2.1.4

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 4/7] cast the arg to md_assemble () to char *
  2016-03-30  1:08 [PATCH 0/7] enable -Wwrite-strings for gas tbsaunde+binutils
                   ` (5 preceding siblings ...)
  2016-03-30  1:14 ` [PATCH 6/7] make xtensa_section_rename () take const char * tbsaunde+binutils
@ 2016-03-30  1:14 ` tbsaunde+binutils
  2016-03-31 10:34 ` [PATCH 0/7] enable -Wwrite-strings for gas Alan Modra
  2016-05-01 16:44 ` Andrew Pinski
  8 siblings, 0 replies; 17+ messages in thread
From: tbsaunde+binutils @ 2016-03-30  1:14 UTC (permalink / raw)
  To: binutils; +Cc: Trevor Saunders

From: Trevor Saunders <tbsaunde+binutils@tbsaunde.org>

For these targets its not clear how md_assemble can usefully be split up so
that part can take const char *.  There is also a fair number of targets that
need md_assemble () to take a char *, so we can't easily make the argument
const.  So since there isn't many callers it seems easiest to just add a couple
of casts.

gas/ChangeLog:

2016-03-29  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* config/tc-m32c.c (m32c_md_end): cast the argument to md_assemble to
	char *.
	(m32c_indirect_operand): Likewise.
	* config/tc-nds32.c (do_pseudo_b): Likewise.
	(do_pseudo_bal): Likewise.
	(do_pseudo_ls_bhw): Likewise.
---
 gas/config/tc-m32c.c  |  8 ++++----
 gas/config/tc-nds32.c | 10 +++++-----
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/gas/config/tc-m32c.c b/gas/config/tc-m32c.c
index 4b6e353..5496f7e 100644
--- a/gas/config/tc-m32c.c
+++ b/gas/config/tc-m32c.c
@@ -200,7 +200,7 @@ m32c_md_end (void)
       /* Pad with nops for objdump.  */
       n_nops = (32 - ((insn_size) % 32)) / 8;
       for (i = 1; i <= n_nops; i++)
-	md_assemble ("nop");
+	md_assemble ((char *) "nop");
     }
 }
 
@@ -317,11 +317,11 @@ m32c_indirect_operand (char *str)
       }
 
   if (indirection[1] != none && indirection[2] != none)
-    md_assemble ("src-dest-indirect");
+    md_assemble ((char *) "src-dest-indirect");
   else if (indirection[1] != none)
-    md_assemble ("src-indirect");
+    md_assemble ((char *) "src-indirect");
   else if (indirection[2] != none)
-    md_assemble ("dest-indirect");
+    md_assemble ((char *) "dest-indirect");
 
   md_assemble (new_str);
   free (new_str);
diff --git a/gas/config/tc-nds32.c b/gas/config/tc-nds32.c
index 4c31f43..0d7d346 100644
--- a/gas/config/tc-nds32.c
+++ b/gas/config/tc-nds32.c
@@ -2202,8 +2202,8 @@ do_pseudo_b (int argc ATTRIBUTE_UNUSED, char *argv[], int pv ATTRIBUTE_UNUSED)
     {
       md_assemblef ("sethi $ta,hi20(%s)", arg_label);
       md_assemblef ("ori $ta,$ta,lo12(%s)", arg_label);
-      md_assemble  ("add $ta,$ta,$gp");
-      md_assemble  ("jr $ta");
+      md_assemble  ((char *) "add $ta,$ta,$gp");
+      md_assemble  ((char *) "jr $ta");
     }
   else
     {
@@ -2223,8 +2223,8 @@ do_pseudo_bal (int argc ATTRIBUTE_UNUSED, char *argv[], int pv ATTRIBUTE_UNUSED)
     {
       md_assemblef ("sethi $ta,hi20(%s)", arg_label);
       md_assemblef ("ori $ta,$ta,lo12(%s)", arg_label);
-      md_assemble  ("add $ta,$ta,$gp");
-      md_assemble ("jral $ta");
+      md_assemble  ((char *) "add $ta,$ta,$gp");
+      md_assemble ((char *) "jral $ta");
     }
   else
     {
@@ -2483,7 +2483,7 @@ do_pseudo_ls_bhw (int argc ATTRIBUTE_UNUSED, char *argv[], int pv)
 	  /* lw */
 	  md_assemblef ("sethi $ta,hi20(%s)", argv[1]);
 	  md_assemblef ("ori $ta,$ta,lo12(%s)", argv[1]);
-	  md_assemble ("lw $ta,[$gp+$ta]");	/* Load address word.  */
+	  md_assemble ((char *) "lw $ta,[$gp+$ta]");	/* Load address word.  */
 	  if (addend < 0x10000 && addend >= -0x10000)
 	    {
 	      md_assemblef ("%c%c%si %s,[$ta+(%d)]", ls, size, sign, argv[0], addend);
-- 
2.1.4

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 0/7] enable -Wwrite-strings for gas
  2016-03-30  1:08 [PATCH 0/7] enable -Wwrite-strings for gas tbsaunde+binutils
                   ` (6 preceding siblings ...)
  2016-03-30  1:14 ` [PATCH 4/7] cast the arg to md_assemble () to " tbsaunde+binutils
@ 2016-03-31 10:34 ` Alan Modra
  2016-05-01 16:44 ` Andrew Pinski
  8 siblings, 0 replies; 17+ messages in thread
From: Alan Modra @ 2016-03-31 10:34 UTC (permalink / raw)
  To: tbsaunde+binutils; +Cc: binutils

On Tue, Mar 29, 2016 at 09:12:54PM -0400, tbsaunde+binutils@tbsaunde.org wrote:
>   cast literal to char * when assigning to input_line_ptr
>   work around get_symbol_name () in sparc and ia64
>   cast to char * when assigning to optarg
>   cast the arg to md_assemble () to char *
>   tc-i960.c: add some casts when assigning literals to args[i]
>   make xtensa_section_rename () take const char *
>   enable -Wwrite-strings for gas

These are all OK.

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 7/7] enable -Wwrite-strings for gas
  2016-03-30  1:08 ` [PATCH 7/7] enable -Wwrite-strings for gas tbsaunde+binutils
@ 2016-04-01 11:22   ` Jiong Wang
  2016-04-01 12:17     ` Trevor Saunders
  2016-04-01 12:40     ` Alan Modra
  0 siblings, 2 replies; 17+ messages in thread
From: Jiong Wang @ 2016-04-01 11:22 UTC (permalink / raw)
  To: tbsaunde+binutils; +Cc: binutils


On 30/03/16 02:13, tbsaunde+binutils@tbsaunde.org wrote:
> From: Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
>
> 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-29  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
>
> 	* configure: Regenerate.
>
> gprof/ChangeLog:
>
> 2016-03-29  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
>
> 	* configure: Regenerate.
>
> ld/ChangeLog:
>
> 2016-03-29  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
>
> 	* configure: Regenerate.
>
> opcodes/ChangeLog:
>
> 2016-03-29  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
>
> 	* configure: Regenerate.
>
> bfd/ChangeLog:
>
> 2016-03-29  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
>
> 	* configure: Regenerate.
> 	* warning.m4: Add WARN_WRITE_STRINGS AC_SUBST.
>
> gold/ChangeLog:
>
> 2016-03-29  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
>
> 	* configure: Regenerate.
>
> gas/ChangeLog:
>
> 2016-03-29  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
>
> 	* Makefile.am: Add WARN_WRITE_STRINGS to WARN_CFLAGS.
> 	* Makefile.in: Regenerate.
> 	* configure: Likewise.


This caused build failures when binutils-gdb is configured with 
--disable-nls, for example:

../configure --disable-nls
make


../../binutils-gdb-commit/gas/expr.c: In function ‘expr’:
../../binutils-gdb-commit/gas/expr.c:1919:8: error: passing argument 1 
of ‘as_warn_value_out_of_range’ discards ‘const’ qualifier from pointer 
target type [-Werror]
         NULL, 0);

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 7/7] enable -Wwrite-strings for gas
  2016-04-01 11:22   ` Jiong Wang
@ 2016-04-01 12:17     ` Trevor Saunders
  2016-04-01 12:40     ` Alan Modra
  1 sibling, 0 replies; 17+ messages in thread
From: Trevor Saunders @ 2016-04-01 12:17 UTC (permalink / raw)
  To: Jiong Wang; +Cc: tbsaunde+binutils, binutils

On Fri, Apr 01, 2016 at 12:21:46PM +0100, Jiong Wang wrote:
> 
> On 30/03/16 02:13, tbsaunde+binutils@tbsaunde.org wrote:
> >From: Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
> >
> >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-29  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
> >
> >	* configure: Regenerate.
> >
> >gprof/ChangeLog:
> >
> >2016-03-29  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
> >
> >	* configure: Regenerate.
> >
> >ld/ChangeLog:
> >
> >2016-03-29  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
> >
> >	* configure: Regenerate.
> >
> >opcodes/ChangeLog:
> >
> >2016-03-29  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
> >
> >	* configure: Regenerate.
> >
> >bfd/ChangeLog:
> >
> >2016-03-29  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
> >
> >	* configure: Regenerate.
> >	* warning.m4: Add WARN_WRITE_STRINGS AC_SUBST.
> >
> >gold/ChangeLog:
> >
> >2016-03-29  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
> >
> >	* configure: Regenerate.
> >
> >gas/ChangeLog:
> >
> >2016-03-29  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
> >
> >	* Makefile.am: Add WARN_WRITE_STRINGS to WARN_CFLAGS.
> >	* Makefile.in: Regenerate.
> >	* configure: Likewise.
> 
> 
> This caused build failures when binutils-gdb is configured with
> --disable-nls, for example:
> 
> ../configure --disable-nls
> make
> 
> 
> ../../binutils-gdb-commit/gas/expr.c: In function ‘expr’:
> ../../binutils-gdb-commit/gas/expr.c:1919:8: error: passing argument 1 of
> ‘as_warn_value_out_of_range’ discards ‘const’ qualifier from pointer target
> type [-Werror]
>         NULL, 0);

bleh, it looks like asintl.h does
#define _(string) (string)
which isn't compatible with the standard prototype of gettext().  I
expect adding a cast there should fix it, though maybe you need to fix a
couple other macros there?  I'll start testing that in a few minutes.

sorry about the breakage.

Trev

> 

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 7/7] enable -Wwrite-strings for gas
  2016-04-01 11:22   ` Jiong Wang
  2016-04-01 12:17     ` Trevor Saunders
@ 2016-04-01 12:40     ` Alan Modra
  2016-04-01 13:10       ` Trevor Saunders
  1 sibling, 1 reply; 17+ messages in thread
From: Alan Modra @ 2016-04-01 12:40 UTC (permalink / raw)
  To: Jiong Wang; +Cc: tbsaunde+binutils, binutils

On Fri, Apr 01, 2016 at 12:21:46PM +0100, Jiong Wang wrote:
> This caused build failures when binutils-gdb is configured with
> --disable-nls, for example:

Constify more

	* cgen.c (weak_operand_overflow_check): Return const char*.
	* messages.c (as_internal_value_out_of_range): Formatting.
	(as_warn_value_out_of_range): Consify prefix param.
	(as_bad_value_out_of_range): Likewise.
	* read.c (s_errwarn): Constify msg..
	(s_float_space, float_cons): ..and err.
	* as.h (as_warn_value_out_of_range, as_bad_value_out_of_range,
	ieee_md_atof, vax_md_atof): Update prototypes.
	* tc.h (md_atof): Update prototype.
	* config/atof-ieee.c (ieee_md_atof): Return const char*.
	* config/atof-vax.c (vax_md_atof): Likewise.
	* config/obj-elf.c (obj_elf_parse_section_letters): Constify bad_msg.
	* config/tc-aarch64.c (md_atof): Return const char*.
	* config/tc-alpha.c (s_alpha_section_name): Likewise.
	(s_alpha_comm): Constify sec_name.
	(section_name): Constify.
	(s_alpha_section): Consify name..
	(alpha_elf_section_letter): ..and ptr_msg param..
	(md_atof): ..and return.
	* config/tc-alpha.h (alpha_elf_section_letter): Update prototype.
	* config/tc-arc.c (md_atof): Return const char*.
	* config/tc-arm.c (md_atof): Likewise.
	* config/tc-avr.c (md_atof): Likewise.
	* config/tc-bfin.c (md_atof): Likewise.
	* config/tc-cr16.c (md_atof): Likewise.
	* config/tc-cris.c (md_atof): Likewise.
	* config/tc-crx.c (md_atof): Likewise.
	* config/tc-d10v.c (md_atof): Likewise.
	* config/tc-d30v.c (md_atof): Likewise.
	* config/tc-dlx.c (md_atof): Likewise.
	* config/tc-epiphany.c (md_atof): Likewise.
	* config/tc-fr30.c (md_atof): Likewise.
	* config/tc-frv.c (md_atof): Likewise.
	* config/tc-ft32.c (md_atof): Likewise.
	* config/tc-h8300.c (md_atof): Likewise.
	* config/tc-hppa.c (struct default_subspace_dict): Constify name.
	(struct default_space_dict): Likewise.
	(create_new_space): Constify name param.
	(create_new_subspace): Likewise.
	(is_defined_space, is_defined_subspace): Likewise.
	(pa_parse_space_stmt): Constify space_name param.
	(md_atof): Return const char*.
	(pa_spaces_begin): Constify name.
	* config/tc-i370.c (md_atof): Return const char*.
	* config/tc-i386.c (md_atof): Likewise.
	(x86_64_section_letter): Constify ptr_msg param.
	* config/tc-i386.h (x86_64_section_letter): Update prototype.
	* config/tc-i860.c (struct i860_it): Constify error.
	(md_atof): Return const char*.
	* config/tc-i960.c (md_atof): Likewise.
	* config/tc-ia64.c (md_atof): Likewise.
	(ia64_elf_section_letter): Constify ptr_msg param.
	* config/tc-ia64.h (ia64_elf_section_letter): Update prototype.
	* config/tc-ip2k.c (md_atof): Return const char*.
	* config/tc-iq2000.c (md_atof): Likewise.
	* config/tc-lm32.c (md_atof): Likewise.
	* config/tc-m32c.c (md_atof): Likewise.
	* config/tc-m32r.c (md_atof): Likewise.
	* config/tc-m68hc11.c (md_atof): Likewise.
	* config/tc-m68k.c (md_atof): Likewise.
	* config/tc-mcore.c (md_atof): Likewise.
	* config/tc-mep.c (md_atof): Likewise.
	(mep_elf_section_letter): Constify ptr_msg param.
	* config/tc-mep.h (mep_elf_section_letter): Update prototype.
	* config/tc-metag.c (md_atof): Return const char*.
	* config/tc-microblaze.c (md_atof): Likewise.
	* config/tc-microblaze.h (md_atof): Delete prototype.
	* config/tc-mips.c (mips_parse_argument_token): Constify err.
	(md_atof): Return const char*.
	* config/tc-mmix.c (md_atof): Likewise.
	* config/tc-mn10200.c (md_atof): Likewise.
	* config/tc-mn10300.c (md_atof): Likewise.
	* config/tc-moxie.c (md_atof): Likewise.
	* config/tc-msp430.c (md_atof): Likewise.
	* config/tc-mt.c (md_atof): Likewise.
	* config/tc-nds32.c (md_atof): Likewise.
	* config/tc-nios2.c (md_atof): Likewise.
	(nios2_elf_section_letter): Constify ptr_msg param.
	* config/tc-nios2.h (nios2_elf_section_letter): Update prototype.
	* config/tc-ns32k.c (md_atof): Return const char*.
	* config/tc-or1k.c (md_atof): Likewise.
	* config/tc-pdp11.c (struct pdp11_code): Constify error.
	(md_atof): Return const char*.
	* config/tc-pj.c (md_atof): Likewise.
	* config/tc-ppc.c (md_atof): Likewise.
	* config/tc-rl78.c (md_atof): Likewise.
	* config/tc-rx.c (md_atof): Likewise.
	* config/tc-s390.c (md_atof): Likewise.
	* config/tc-score.c (s3_atof, md_atof): Likewise.
	* config/tc-sh.c (md_atof): Likewise.
	* config/tc-sparc.c (struct sparc_it): Constify error.
	(md_atof): Return const char*.
	* config/tc-spu.c (md_atof): Likewise.
	* config/tc-tic30.c (md_atof): Likewise.
	* config/tc-tic4x.c (md_atof): Likewise.
	* config/tc-tic54x.c (md_atof): Likewise.
	* config/tc-tic6x.c (md_atof): Likewise.
	* config/tc-tilegx.c (md_atof): Likewise.
	* config/tc-tilepro.c (md_atof): Likewise.
	* config/tc-v850.c (parse_register_list, md_atof): Likewise.
	* config/tc-vax.c (md_atof): Likewise.
	* config/tc-visium.c (md_atof): Likewise.
	* config/tc-xc16x.c (md_atof): Likewise.
	* config/tc-xgate.c (md_atof): Likewise.
	* config/tc-xstormy16.c (md_atof): Likewise.
	* config/tc-xtensa.c (md_atof): Likewise.
	* config/tc-z80.c (md_atof): Likewise.
	* config/tc-z8k.c (md_atof): Likewise.

diff --git a/gas/as.h b/gas/as.h
index ba2fb7d..9ff8bb8 100644
--- a/gas/as.h
+++ b/gas/as.h
@@ -477,15 +477,15 @@ void   as_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;
 void   sprint_value (char *, addressT);
 int    had_errors (void);
 int    had_warnings (void);
-void   as_warn_value_out_of_range (char *, offsetT, offsetT, offsetT,
+void   as_warn_value_out_of_range (const char *, offsetT, offsetT, offsetT,
 				   const char *, unsigned);
-void   as_bad_value_out_of_range (char *, offsetT, offsetT, offsetT,
+void   as_bad_value_out_of_range (const char *, offsetT, offsetT, offsetT,
 				  const char *, unsigned);
 void   print_version_id (void);
 char * app_push (void);
 char * atof_ieee (char *, int, LITTLENUM_TYPE *);
-char * ieee_md_atof (int, char *, int *, bfd_boolean);
-char * vax_md_atof (int, char *, int *);
+const char * ieee_md_atof (int, char *, int *, bfd_boolean);
+const char * vax_md_atof (int, char *, int *);
 char * input_scrub_include_file (const char *, char *);
 void   input_scrub_insert_line (const char *);
 void   input_scrub_insert_file (char *);
diff --git a/gas/cgen.c b/gas/cgen.c
index 41eaa55..c04a921 100644
--- a/gas/cgen.c
+++ b/gas/cgen.c
@@ -37,7 +37,7 @@ static unsigned long gas_cgen_encode_addend
    const unsigned long, const unsigned long, const unsigned long, \
    const unsigned long);
 
-static char * weak_operand_overflow_check
+static const char * weak_operand_overflow_check
   (const expressionS *, const CGEN_OPERAND *);
 
 static void queue_fixup_recursively
@@ -748,7 +748,7 @@ gas_cgen_encode_addend (const unsigned long start,    /* in bits */
    overflow, so signal it by returning an error string. Any other case is
    ambiguous, so we assume it's OK and return NULL.  */
 
-static char *
+static const char *
 weak_operand_overflow_check (const expressionS *  exp,
 			     const CGEN_OPERAND * operand)
 {
diff --git a/gas/config/atof-ieee.c b/gas/config/atof-ieee.c
index 92c367d..636549e 100644
--- a/gas/config/atof-ieee.c
+++ b/gas/config/atof-ieee.c
@@ -710,7 +710,7 @@ extern const char FLT_CHARS[];
 
    An error message is returned, or a NULL pointer if everything went OK.  */
 
-char *
+const char *
 ieee_md_atof (int type,
 	      char *litP,
 	      int *sizeP,
diff --git a/gas/config/atof-vax.c b/gas/config/atof-vax.c
index 7c05390..8ca80b0 100644
--- a/gas/config/atof-vax.c
+++ b/gas/config/atof-vax.c
@@ -387,7 +387,7 @@ flonum_gen2vax (int format_letter,	/* One of 'd' 'f' 'g' 'h'.  */
 
 #define MAXIMUM_NUMBER_OF_LITTLENUMS  8 	/* For .hfloats.  */
 
-char *
+const char *
 vax_md_atof (int what_statement_type,
 	     char *literalP,
 	     int *sizeP)
diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c
index 40c6e35..1d07d4b 100644
--- a/gas/config/obj-elf.c
+++ b/gas/config/obj-elf.c
@@ -815,7 +815,8 @@ obj_elf_parse_section_letters (char *str, size_t len, bfd_boolean *is_clone)
 	    }
 	default:
 	  {
-	    char *bad_msg = _("unrecognized .section attribute: want a,e,w,x,M,S,G,T or number");
+	    const char *bad_msg = _("unrecognized .section attribute:"
+				    " want a,e,w,x,M,S,G,T or number");
 #ifdef md_elf_section_letter
 	    bfd_vma md_attr = md_elf_section_letter (*str, &bad_msg);
 	    if (md_attr != (bfd_vma) -1)
diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c
index 0e00259..14b6011 100644
--- a/gas/config/tc-aarch64.c
+++ b/gas/config/tc-aarch64.c
@@ -573,7 +573,7 @@ my_get_expression (expressionS * ep, char **str, int prefix_mode,
    of LITTLENUMS emitted is stored in *SIZEP.  An error message is
    returned, or NULL on OK.  */
 
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
   return ieee_md_atof (type, litP, sizeP, target_big_endian);
diff --git a/gas/config/tc-alpha.c b/gas/config/tc-alpha.c
index 5fa1403..5fe9cb6 100644
--- a/gas/config/tc-alpha.c
+++ b/gas/config/tc-alpha.c
@@ -578,7 +578,7 @@ static void assemble_insn (const struct alpha_opcode *, const expressionS *, int
 static void emit_insn (struct alpha_insn *);
 static void assemble_tokens (const char *, const expressionS *, int, int);
 #ifdef OBJ_EVAX
-static char *s_alpha_section_name (void);
+static const char *s_alpha_section_name (void);
 static symbolS *add_to_link_pool (symbolS *, offsetT);
 #endif
 \f
@@ -3552,7 +3552,7 @@ s_alpha_comm (int ignore ATTRIBUTE_UNUSED)
          The symbol is effectively an alias for the section name.  */
 
       segT sec;
-      char *sec_name;
+      const char *sec_name;
       symbolS *sec_symbol;
       segT current_seg = now_seg;
       subsegT current_subseg = now_subseg;
@@ -4184,7 +4184,7 @@ alpha_cfi_frame_initial_instructions (void)
 #ifdef OBJ_EVAX
 
 /* Get name of section.  */
-static char *
+static const char *
 s_alpha_section_name (void)
 {
   char *name;
@@ -4292,13 +4292,14 @@ s_alpha_section_word (char *str, size_t len)
 
 #define EVAX_SECTION_COUNT 5
 
-static char *section_name[EVAX_SECTION_COUNT + 1] =
+static const char *section_name[EVAX_SECTION_COUNT + 1] =
   { "NULL", ".rdata", ".comm", ".link", ".ctors", ".dtors" };
 
 static void
 s_alpha_section (int secid)
 {
-  char *name, *beg;
+  const char *name;
+  char *beg;
   segT sec;
   flagword vms_flags = 0;
   symbolS *symbol;
@@ -5340,7 +5341,7 @@ select_gp_value (void)
 /* Map 's' to SHF_ALPHA_GPREL.  */
 
 bfd_vma
-alpha_elf_section_letter (int letter, char **ptr_msg)
+alpha_elf_section_letter (int letter, const char **ptr_msg)
 {
   if (letter == 's')
     return SHF_ALPHA_GPREL;
@@ -5579,10 +5580,10 @@ md_section_align (segT seg, valueT size)
    of LITTLENUMS emitted is stored in *SIZEP.  An error message is
    returned, or NULL on OK.  */
 
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
-  extern char *vax_md_atof (int, char *, int *);
+  extern const char *vax_md_atof (int, char *, int *);
 
   switch (type)
     {
diff --git a/gas/config/tc-alpha.h b/gas/config/tc-alpha.h
index 326f23b..1a7badc 100644
--- a/gas/config/tc-alpha.h
+++ b/gas/config/tc-alpha.h
@@ -122,7 +122,7 @@ extern void alpha_frob_file_before_adjust (void);
 
 #ifdef OBJ_ELF
 #define md_elf_section_letter		alpha_elf_section_letter
-extern bfd_vma alpha_elf_section_letter (int, char **);
+extern bfd_vma alpha_elf_section_letter (int, const char **);
 #define md_elf_section_flags		alpha_elf_section_flags
 extern flagword alpha_elf_section_flags (flagword, bfd_vma, int);
 #endif
diff --git a/gas/config/tc-arc.c b/gas/config/tc-arc.c
index 3f4e2d3..f3f7e26 100644
--- a/gas/config/tc-arc.c
+++ b/gas/config/tc-arc.c
@@ -2848,7 +2848,7 @@ md_undefined_symbol (char *name)
    of LITTLENUMS emitted is stored in *sizeP.  An error message is
    returned, or NULL on OK.  */
 
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
   return ieee_md_atof (type, litP, sizeP, target_big_endian);
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index 2c42a13..2ccc053 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -1077,7 +1077,7 @@ my_get_expression (expressionS * ep, char ** str, int prefix_mode)
 
    ??? The format of 12 byte floats is uncertain according to gcc's arm.h.  */
 
-char *
+const char *
 md_atof (int type, char * litP, int * sizeP)
 {
   int prec;
diff --git a/gas/config/tc-avr.c b/gas/config/tc-avr.c
index b35061e..852002f 100644
--- a/gas/config/tc-avr.c
+++ b/gas/config/tc-avr.c
@@ -628,7 +628,7 @@ md_undefined_symbol (char *name ATTRIBUTE_UNUSED)
   return NULL;
 }
 
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
   return ieee_md_atof (type, litP, sizeP, FALSE);
diff --git a/gas/config/tc-bfin.c b/gas/config/tc-bfin.c
index 6dce28c..caa89c6 100644
--- a/gas/config/tc-bfin.c
+++ b/gas/config/tc-bfin.c
@@ -798,7 +798,7 @@ md_section_align (segT segment, valueT size)
 }
 
 
-char *
+const char *
 md_atof (int type, char * litP, int * sizeP)
 {
   return ieee_md_atof (type, litP, sizeP, FALSE);
diff --git a/gas/config/tc-cr16.c b/gas/config/tc-cr16.c
index 45201ca..119f130 100644
--- a/gas/config/tc-cr16.c
+++ b/gas/config/tc-cr16.c
@@ -715,7 +715,7 @@ md_show_usage (FILE *stream ATTRIBUTE_UNUSED)
   return;
 }
 
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
   return ieee_md_atof (type, litP, sizeP, target_big_endian);
diff --git a/gas/config/tc-cris.c b/gas/config/tc-cris.c
index 89343f0..536e6cb 100644
--- a/gas/config/tc-cris.c
+++ b/gas/config/tc-cris.c
@@ -3591,7 +3591,7 @@ cris_get_reloc_suffix (char **cPP, bfd_reloc_code_real_type *relocp,
    code as assembly code, but if they do, they should be able enough to
    find out the correct bit patterns and use them.  */
 
-char *
+const char *
 md_atof (int type ATTRIBUTE_UNUSED, char *litp ATTRIBUTE_UNUSED,
 	 int *sizep ATTRIBUTE_UNUSED)
 {
diff --git a/gas/config/tc-crx.c b/gas/config/tc-crx.c
index 40a2806..7c8d7ed 100644
--- a/gas/config/tc-crx.c
+++ b/gas/config/tc-crx.c
@@ -464,7 +464,7 @@ md_show_usage (FILE *stream ATTRIBUTE_UNUSED)
   return;
 }
 
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
   return ieee_md_atof (type, litP, sizeP, target_big_endian);
diff --git a/gas/config/tc-d10v.c b/gas/config/tc-d10v.c
index f7f213a..e2a2caa 100644
--- a/gas/config/tc-d10v.c
+++ b/gas/config/tc-d10v.c
@@ -251,7 +251,7 @@ md_undefined_symbol (char *name ATTRIBUTE_UNUSED)
   return 0;
 }
 
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
   return ieee_md_atof (type, litP, sizeP, TRUE);
diff --git a/gas/config/tc-d30v.c b/gas/config/tc-d30v.c
index 81051f0..ae870ee 100644
--- a/gas/config/tc-d30v.c
+++ b/gas/config/tc-d30v.c
@@ -285,7 +285,7 @@ md_undefined_symbol (char *name ATTRIBUTE_UNUSED)
   return 0;
 }
 
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
   return ieee_md_atof (type, litP, sizeP, TRUE);
diff --git a/gas/config/tc-dlx.c b/gas/config/tc-dlx.c
index 970e297..a806fe6 100644
--- a/gas/config/tc-dlx.c
+++ b/gas/config/tc-dlx.c
@@ -974,7 +974,7 @@ md_assemble (char *str)
    but I'm not sure.  Dlx will not use it anyway, so I just leave it
    here for now.  */
 
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
   return ieee_md_atof (type, litP, sizeP, TRUE);
diff --git a/gas/config/tc-epiphany.c b/gas/config/tc-epiphany.c
index 132a78f..f35198e 100644
--- a/gas/config/tc-epiphany.c
+++ b/gas/config/tc-epiphany.c
@@ -1012,7 +1012,7 @@ md_cgen_lookup_reloc (const CGEN_INSN *insn ATTRIBUTE_UNUSED,
 /* Equal to MAX_PRECISION in atof-ieee.c.  */
 #define MAX_LITTLENUMS 6
 
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
   return ieee_md_atof (type, litP, sizeP, FALSE);
diff --git a/gas/config/tc-fr30.c b/gas/config/tc-fr30.c
index ad3ffd0..058733b 100644
--- a/gas/config/tc-fr30.c
+++ b/gas/config/tc-fr30.c
@@ -317,7 +317,7 @@ md_number_to_chars (char * buf, valueT val, int n)
   number_to_chars_bigendian (buf, val, n);
 }
 
-char *
+const char *
 md_atof (int type, char * litP, int * sizeP)
 {
   return ieee_md_atof (type, litP, sizeP, TRUE);
diff --git a/gas/config/tc-frv.c b/gas/config/tc-frv.c
index 24baa96..61d17a7 100644
--- a/gas/config/tc-frv.c
+++ b/gas/config/tc-frv.c
@@ -1513,7 +1513,7 @@ frv_md_number_to_chars (char *buf, valueT val, int n)
   number_to_chars_bigendian (buf, val, n);
 }
 
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
   return ieee_md_atof (type, litP, sizeP, TRUE);
diff --git a/gas/config/tc-ft32.c b/gas/config/tc-ft32.c
index 327b393..56c0a68 100644
--- a/gas/config/tc-ft32.c
+++ b/gas/config/tc-ft32.c
@@ -408,7 +408,7 @@ md_assemble (char *str)
    of LITTLENUMS emitted is stored in *SIZEP .  An error message is
    returned, or NULL on OK.  */
 
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
   int prec;
diff --git a/gas/config/tc-h8300.c b/gas/config/tc-h8300.c
index f50f497..edca456 100644
--- a/gas/config/tc-h8300.c
+++ b/gas/config/tc-h8300.c
@@ -2101,7 +2101,7 @@ md_undefined_symbol (char *name ATTRIBUTE_UNUSED)
 
 /* Various routines to kill one day.  */
 
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
   return ieee_md_atof (type, litP, sizeP, TRUE);
diff --git a/gas/config/tc-hppa.c b/gas/config/tc-hppa.c
index c2001bd..82d33c2 100644
--- a/gas/config/tc-hppa.c
+++ b/gas/config/tc-hppa.c
@@ -350,7 +350,7 @@ typedef struct space_dictionary_chain sd_chain_struct;
 struct default_subspace_dict
   {
     /* Name of the subspace.  */
-    char *name;
+    const char *name;
 
     /* FIXME.  Is this still needed?  */
     char defined;
@@ -403,7 +403,7 @@ struct default_subspace_dict
 struct default_space_dict
   {
     /* Name of the space.  */
-    char *name;
+    const char *name;
 
     /* Space number.  It is possible to identify spaces within
        assembly code numerically!  */
@@ -503,27 +503,27 @@ static void pa_align (int);
 static void pa_space (int);
 static void pa_spnum (int);
 static void pa_subspace (int);
-static sd_chain_struct *create_new_space (char *, int, int,
-						  int, int, int,
-						  asection *, int);
+static sd_chain_struct *create_new_space (const char *, int, int,
+					  int, int, int,
+					  asection *, int);
 static ssd_chain_struct *create_new_subspace (sd_chain_struct *,
-						      char *, int, int,
-						      int, int, int, int,
-						      int, int, int, int,
-						      int, asection *);
+					      const char *, int, int,
+					      int, int, int, int,
+					      int, int, int, int,
+					      int, asection *);
 static ssd_chain_struct *update_subspace (sd_chain_struct *,
-						  char *, int, int, int,
-						  int, int, int, int,
-						  int, int, int, int,
-						  asection *);
-static sd_chain_struct *is_defined_space (char *);
-static ssd_chain_struct *is_defined_subspace (char *);
+					  char *, int, int, int,
+					  int, int, int, int,
+					  int, int, int, int,
+					  asection *);
+static sd_chain_struct *is_defined_space (const char *);
+static ssd_chain_struct *is_defined_subspace (const char *);
 static sd_chain_struct *pa_segment_to_space (asection *);
 static ssd_chain_struct *pa_subsegment_to_subspace (asection *,
 							    subsegT);
 static sd_chain_struct *pa_find_space_by_number (int);
 static unsigned int pa_subspace_start (sd_chain_struct *, int);
-static sd_chain_struct *pa_parse_space_stmt (char *, int);
+static sd_chain_struct *pa_parse_space_stmt (const char *, int);
 #endif
 
 /* File and globally scoped variable declarations.  */
@@ -1319,7 +1319,7 @@ pa_parse_nullif (char **s)
   return nullif;
 }
 
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
   return ieee_md_atof (type, litP, sizeP, TRUE);
@@ -7080,7 +7080,7 @@ pa_check_current_space_and_subspace (void)
    by the parameters to the .SPACE directive.  */
 
 static sd_chain_struct *
-pa_parse_space_stmt (char *space_name, int create_flag)
+pa_parse_space_stmt (const char *space_name, int create_flag)
 {
   char *name, *ptemp, c;
   char loadable, defined, private, sort;
@@ -7590,7 +7590,7 @@ pa_spaces_begin (void)
   i = 0;
   while (pa_def_spaces[i].name)
     {
-      char *name;
+      const char *name;
 
       /* Pick the right name to use for the new section.  */
       name = pa_def_spaces[i].name;
@@ -7606,7 +7606,7 @@ pa_spaces_begin (void)
   i = 0;
   while (pa_def_subspaces[i].name)
     {
-      char *name;
+      const char *name;
       int applicable, subsegment;
       asection *segment = NULL;
       sd_chain_struct *space;
@@ -7707,7 +7707,7 @@ pa_spaces_begin (void)
    by the given parameters.  */
 
 static sd_chain_struct *
-create_new_space (char *name,
+create_new_space (const char *name,
 		  int spnum,
 		  int loadable ATTRIBUTE_UNUSED,
 		  int defined,
@@ -7789,7 +7789,7 @@ create_new_space (char *name,
 
 static ssd_chain_struct *
 create_new_subspace (sd_chain_struct *space,
-		     char *name,
+		     const char *name,
 		     int loadable ATTRIBUTE_UNUSED,
 		     int code_only ATTRIBUTE_UNUSED,
 		     int comdat,
@@ -7893,7 +7893,7 @@ update_subspace (sd_chain_struct *space,
    NULL if no such space exists.  */
 
 static sd_chain_struct *
-is_defined_space (char *name)
+is_defined_space (const char *name)
 {
   sd_chain_struct *chain_pointer;
 
@@ -7942,7 +7942,7 @@ pa_segment_to_space (asection *seg)
    own subspace.  */
 
 static ssd_chain_struct *
-is_defined_subspace (char *name)
+is_defined_subspace (const char *name)
 {
   sd_chain_struct *space_chain;
   ssd_chain_struct *subspace_chain;
diff --git a/gas/config/tc-i370.c b/gas/config/tc-i370.c
index 1b419e8..7e2f146 100644
--- a/gas/config/tc-i370.c
+++ b/gas/config/tc-i370.c
@@ -2352,7 +2352,7 @@ i370_tc (int ignore ATTRIBUTE_UNUSED)
     }
 }
 \f
-char *
+const char *
 md_atof (int type, char *litp, int *sizep)
 {
   /* 360/370/390 have two float formats: an old, funky 360 single-precision
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 55ca5c3..ce5304d 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -9378,7 +9378,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
   md_number_to_chars (p, value, fixP->fx_size);
 }
 \f
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
   /* This outputs the LITTLENUMs in REVERSE order;
@@ -10781,7 +10781,7 @@ tc_pe_dwarf2_emit_offset (symbolS *symbol, unsigned int size)
 /* For ELF on x86-64, add support for SHF_X86_64_LARGE.  */
 
 bfd_vma
-x86_64_section_letter (int letter, char **ptr_msg)
+x86_64_section_letter (int letter, const char **ptr_msg)
 {
   if (flag_code == CODE_64BIT)
     {
diff --git a/gas/config/tc-i386.h b/gas/config/tc-i386.h
index 006dacb..7a987d8 100644
--- a/gas/config/tc-i386.h
+++ b/gas/config/tc-i386.h
@@ -310,7 +310,7 @@ extern void i386_solaris_fix_up_eh_frame (segT);
 
 /* Support for SHF_X86_64_LARGE */
 extern bfd_vma x86_64_section_word (char *, size_t);
-extern bfd_vma x86_64_section_letter (int, char **);
+extern bfd_vma x86_64_section_letter (int, const char **);
 #define md_elf_section_letter(LETTER, PTR_MSG)	x86_64_section_letter (LETTER, PTR_MSG)
 #define md_elf_section_word(STR, LEN)		x86_64_section_word (STR, LEN)
 
diff --git a/gas/config/tc-i860.c b/gas/config/tc-i860.c
index ea21669..85855e9 100644
--- a/gas/config/tc-i860.c
+++ b/gas/config/tc-i860.c
@@ -53,7 +53,7 @@ static char reg_prefix;
 
 struct i860_it
 {
-  char *error;
+  const char *error;
   unsigned long opcode;
   enum expand_type expand;
   struct i860_fi
@@ -1010,7 +1010,7 @@ i860_get_expression (char *str)
   return 0;
 }
 
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
   return ieee_md_atof (type, litP, sizeP, TRUE);
diff --git a/gas/config/tc-i960.c b/gas/config/tc-i960.c
index 667ab4c..1335da1 100644
--- a/gas/config/tc-i960.c
+++ b/gas/config/tc-i960.c
@@ -1707,7 +1707,7 @@ md_number_to_chars (char *buf,
   number_to_chars_littleendian (buf, value, n);
 }
 
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
   return ieee_md_atof (type, litP, sizeP, FALSE);
diff --git a/gas/config/tc-ia64.c b/gas/config/tc-ia64.c
index a50b61e..8da09e0 100644
--- a/gas/config/tc-ia64.c
+++ b/gas/config/tc-ia64.c
@@ -856,7 +856,7 @@ set_section (char *name)
 /* Map 's' to SHF_IA_64_SHORT.  */
 
 bfd_vma
-ia64_elf_section_letter (int letter, char **ptr_msg)
+ia64_elf_section_letter (int letter, const char **ptr_msg)
 {
   if (letter == 's')
     return SHF_IA_64_SHORT;
@@ -11576,7 +11576,7 @@ tc_gen_reloc (asection *sec ATTRIBUTE_UNUSED, fixS *fixp)
 
 #define MAX_LITTLENUMS 5
 
-char *
+const char *
 md_atof (int type, char *lit, int *size)
 {
   LITTLENUM_TYPE words[MAX_LITTLENUMS];
diff --git a/gas/config/tc-ia64.h b/gas/config/tc-ia64.h
index 4858c27..dcf07ec 100644
--- a/gas/config/tc-ia64.h
+++ b/gas/config/tc-ia64.h
@@ -110,7 +110,7 @@ extern void ia64_cons_fix_new (fragS *, int, int, expressionS *,
 			       bfd_reloc_code_real_type);
 extern void ia64_validate_fix (struct fix *);
 extern char * ia64_canonicalize_symbol_name (char *);
-extern bfd_vma ia64_elf_section_letter (int, char **);
+extern bfd_vma ia64_elf_section_letter (int, const char **);
 extern flagword ia64_elf_section_flags (flagword, bfd_vma, int);
 extern int ia64_elf_section_type (const char *, size_t);
 extern long ia64_pcrel_from_section (struct fix *, segT);
diff --git a/gas/config/tc-ip2k.c b/gas/config/tc-ip2k.c
index 7e4d351..642dfea 100644
--- a/gas/config/tc-ip2k.c
+++ b/gas/config/tc-ip2k.c
@@ -311,7 +311,7 @@ md_number_to_chars (char * buf, valueT val, int n)
   number_to_chars_bigendian (buf, val, n);
 }
 
-char *
+const char *
 md_atof (int type, char * litP, int *  sizeP)
 {
   return ieee_md_atof (type, litP, sizeP, TRUE);
diff --git a/gas/config/tc-iq2000.c b/gas/config/tc-iq2000.c
index c5ccfca..f1f7945 100644
--- a/gas/config/tc-iq2000.c
+++ b/gas/config/tc-iq2000.c
@@ -724,7 +724,7 @@ md_operand (expressionS * exp)
     gas_cgen_md_operand (exp);
 }
 
-char *
+const char *
 md_atof (int type, char * litP, int * sizeP)
 {
   return ieee_md_atof (type, litP, sizeP, TRUE);
diff --git a/gas/config/tc-lm32.c b/gas/config/tc-lm32.c
index a20b9a0..5f7d703 100644
--- a/gas/config/tc-lm32.c
+++ b/gas/config/tc-lm32.c
@@ -214,7 +214,7 @@ md_number_to_chars (char * buf, valueT val, int n)
    of LITTLENUMS emitted is stored in *SIZEP.  An error message is
    returned, or NULL on OK.  */
 
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
   int i;
diff --git a/gas/config/tc-m32c.c b/gas/config/tc-m32c.c
index 5496f7e..0219d9b 100644
--- a/gas/config/tc-m32c.c
+++ b/gas/config/tc-m32c.c
@@ -1155,7 +1155,7 @@ md_number_to_chars (char * buf, valueT val, int n)
 /* Equal to MAX_PRECISION in atof-ieee.c.  */
 #define MAX_LITTLENUMS 6
 
-char *
+const char *
 md_atof (int type, char * litP, int * sizeP)
 {
   return ieee_md_atof (type, litP, sizeP, TRUE);
diff --git a/gas/config/tc-m32r.c b/gas/config/tc-m32r.c
index 89205f8..126ab9c 100644
--- a/gas/config/tc-m32r.c
+++ b/gas/config/tc-m32r.c
@@ -2106,7 +2106,7 @@ md_number_to_chars (char *buf, valueT val, int n)
 /* Equal to MAX_PRECISION in atof-ieee.c.  */
 #define MAX_LITTLENUMS 6
 
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
   return ieee_md_atof (type, litP, sizeP, target_big_endian);
diff --git a/gas/config/tc-m68hc11.c b/gas/config/tc-m68hc11.c
index 71fdb26..c61bded 100644
--- a/gas/config/tc-m68hc11.c
+++ b/gas/config/tc-m68hc11.c
@@ -574,7 +574,7 @@ md_undefined_symbol (char *name ATTRIBUTE_UNUSED)
   return 0;
 }
 
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
   return ieee_md_atof (type, litP, sizeP, TRUE);
diff --git a/gas/config/tc-m68k.c b/gas/config/tc-m68k.c
index b89f0a9..f148845 100644
--- a/gas/config/tc-m68k.c
+++ b/gas/config/tc-m68k.c
@@ -4879,7 +4879,7 @@ m68k_mri_mode_change (int on)
     }
 }
 
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
   return ieee_md_atof (type, litP, sizeP, TRUE);
diff --git a/gas/config/tc-mcore.c b/gas/config/tc-mcore.c
index dc5c95d..67d1ea8 100644
--- a/gas/config/tc-mcore.c
+++ b/gas/config/tc-mcore.c
@@ -1616,7 +1616,7 @@ md_mcore_end (void)
 
 /* Various routines to kill one day.  */
 
-char *
+const char *
 md_atof (int type, char * litP, int * sizeP)
 {
   return ieee_md_atof (type, litP, sizeP, target_big_endian);
diff --git a/gas/config/tc-mep.c b/gas/config/tc-mep.c
index 6b659d4..6e62ad5 100644
--- a/gas/config/tc-mep.c
+++ b/gas/config/tc-mep.c
@@ -2039,7 +2039,7 @@ md_number_to_chars (char *buf, valueT val, int n)
     number_to_chars_littleendian (buf, val, n);
 }
 
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
   return ieee_md_atof (type, litP, sizeP, TRUE);
@@ -2080,7 +2080,7 @@ mep_fix_adjustable (fixS *fixP)
 }
 
 bfd_vma
-mep_elf_section_letter (int letter, char **ptrmsg)
+mep_elf_section_letter (int letter, const char **ptrmsg)
 {
   if (letter == 'v')
     return SHF_MEP_VLIW;
diff --git a/gas/config/tc-mep.h b/gas/config/tc-mep.h
index c771c21..b711889 100644
--- a/gas/config/tc-mep.h
+++ b/gas/config/tc-mep.h
@@ -106,7 +106,7 @@ extern int mep_unrecognized_line (int);
 extern void mep_cleanup (void);
 
 #define md_elf_section_letter		mep_elf_section_letter
-extern bfd_vma mep_elf_section_letter (int, char **);
+extern bfd_vma mep_elf_section_letter (int, const char **);
 #define md_elf_section_flags		mep_elf_section_flags
 extern flagword mep_elf_section_flags  (flagword, bfd_vma, int);
 
diff --git a/gas/config/tc-metag.c b/gas/config/tc-metag.c
index d287387..cc9140b 100644
--- a/gas/config/tc-metag.c
+++ b/gas/config/tc-metag.c
@@ -6707,7 +6707,7 @@ md_number_to_chars (char * buf, valueT val, int n)
 /* Equal to MAX_PRECISION in atof-ieee.c */
 #define MAX_LITTLENUMS 6
 
-char *
+const char *
 md_atof (int type, char * litP, int * sizeP)
 {
   int              i;
diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c
index a92e0eb..e720ee8 100644
--- a/gas/config/tc-microblaze.c
+++ b/gas/config/tc-microblaze.c
@@ -1758,7 +1758,7 @@ md_undefined_symbol (char * name ATTRIBUTE_UNUSED)
 /* Turn a string in input_line_pointer into a floating point constant of type
    type, and store the appropriate bytes in *litP.  The number of LITTLENUMS
    emitted is stored in *sizeP.  An error message is returned, or NULL on OK.*/
-char *
+const char *
 md_atof (int type, char * litP, int * sizeP)
 {
   int prec;
diff --git a/gas/config/tc-microblaze.h b/gas/config/tc-microblaze.h
index 0fde831..f298a2a 100644
--- a/gas/config/tc-microblaze.h
+++ b/gas/config/tc-microblaze.h
@@ -100,7 +100,6 @@ extern const struct relax_type md_relax_table[];
 extern void      md_begin            (void);
 extern void      md_assemble         (char *);
 extern symbolS * md_undefined_symbol (char *);
-extern char *    md_atof             (int, char *, int *);
 extern void      md_show_usage       (FILE *);
 extern void      md_convert_frag               (bfd *, segT, fragS *);
 extern void      md_operand                    (expressionS *);
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index f2b81f2..ca1098b 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -3042,7 +3042,8 @@ mips_parse_base_start (char *s)
 static char *
 mips_parse_argument_token (char *s, char float_format)
 {
-  char *end, *save_in, *err;
+  char *end, *save_in;
+  const char *err;
   unsigned int regno1, regno2, channels;
   struct mips_operand_token token;
 
@@ -13996,7 +13997,7 @@ my_getExpression (expressionS *ep, char *str)
   input_line_pointer = save_in;
 }
 
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
   return ieee_md_atof (type, litP, sizeP, target_big_endian);
diff --git a/gas/config/tc-mmix.c b/gas/config/tc-mmix.c
index 00543f4..2400a0b 100644
--- a/gas/config/tc-mmix.c
+++ b/gas/config/tc-mmix.c
@@ -2272,7 +2272,7 @@ md_estimate_size_before_relax (fragS *fragP, segT segment)
    emitted is stored in *sizeP .  An error message is returned, or NULL on
    OK.  */
 
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
   if (type == 'r')
diff --git a/gas/config/tc-mn10200.c b/gas/config/tc-mn10200.c
index ea2fa8f..2cdfa68 100644
--- a/gas/config/tc-mn10200.c
+++ b/gas/config/tc-mn10200.c
@@ -314,7 +314,7 @@ md_undefined_symbol (char *name ATTRIBUTE_UNUSED)
   return 0;
 }
 
-char *
+const char *
 md_atof (int type, char *litp, int *sizep)
 {
   return ieee_md_atof (type, litp, sizep, FALSE);
diff --git a/gas/config/tc-mn10300.c b/gas/config/tc-mn10300.c
index 4f76677..9a5d3be 100644
--- a/gas/config/tc-mn10300.c
+++ b/gas/config/tc-mn10300.c
@@ -455,7 +455,7 @@ md_undefined_symbol (char *name ATTRIBUTE_UNUSED)
   return 0;
 }
 
-char *
+const char *
 md_atof (int type, char *litp, int *sizep)
 {
   return ieee_md_atof (type, litp, sizep, FALSE);
diff --git a/gas/config/tc-moxie.c b/gas/config/tc-moxie.c
index aa48c99..24c9aec 100644
--- a/gas/config/tc-moxie.c
+++ b/gas/config/tc-moxie.c
@@ -556,7 +556,7 @@ md_assemble (char *str)
    of LITTLENUMS emitted is stored in *SIZEP .  An error message is
    returned, or NULL on OK.  */
 
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
   int prec;
diff --git a/gas/config/tc-msp430.c b/gas/config/tc-msp430.c
index 98910aa..3621fdb 100644
--- a/gas/config/tc-msp430.c
+++ b/gas/config/tc-msp430.c
@@ -1630,7 +1630,7 @@ extract_cmd (char * from, char * to, int limit)
   return from;
 }
 
-char *
+const char *
 md_atof (int type, char * litP, int * sizeP)
 {
   return ieee_md_atof (type, litP, sizeP, FALSE);
diff --git a/gas/config/tc-mt.c b/gas/config/tc-mt.c
index c9aa18c..e0bca88 100644
--- a/gas/config/tc-mt.c
+++ b/gas/config/tc-mt.c
@@ -433,7 +433,7 @@ md_number_to_chars (char * buf, valueT val, int n)
   number_to_chars_bigendian (buf, val, n);
 }
 
-char *
+const char *
 md_atof (int type, char * litP, int * sizeP)
 {
   return ieee_md_atof (type, litP, sizeP, FALSE);
diff --git a/gas/config/tc-nds32.c b/gas/config/tc-nds32.c
index 0d7d346..897561d 100644
--- a/gas/config/tc-nds32.c
+++ b/gas/config/tc-nds32.c
@@ -6064,7 +6064,7 @@ md_number_to_chars (char *buf, valueT val, int n)
 /* This function is called to convert an ASCII string into a floating point
    value in format used by the CPU.  */
 
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
   int i;
diff --git a/gas/config/tc-nios2.c b/gas/config/tc-nios2.c
index 399fcf0..bf37ff7 100644
--- a/gas/config/tc-nios2.c
+++ b/gas/config/tc-nios2.c
@@ -264,7 +264,7 @@ md_number_to_chars (char *buf, valueT val, int n)
    of type TYPE, and store the appropriate bytes in *LITP.  The number
    of LITTLENUMS emitted is stored in *SIZEP.  An error message is
    returned, or NULL on OK.  */
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
   int prec;
@@ -3980,7 +3980,7 @@ nios2_cons_align (int size)
 /* Map 's' to SHF_NIOS2_GPREL.  */
 /* This is from the Alpha code tc-alpha.c.  */
 int
-nios2_elf_section_letter (int letter, char **ptr_msg)
+nios2_elf_section_letter (int letter, const char **ptr_msg)
 {
   if (letter == 's')
     return SHF_NIOS2_GPREL;
diff --git a/gas/config/tc-nios2.h b/gas/config/tc-nios2.h
index 05cc596..3612c33 100644
--- a/gas/config/tc-nios2.h
+++ b/gas/config/tc-nios2.h
@@ -92,7 +92,7 @@ extern long nios2_relax_frag (segT segment, fragS * fragP, long stretch);
 
 /* Processor-specific section directives.  */
 #define md_elf_section_letter		nios2_elf_section_letter
-extern int nios2_elf_section_letter (int, char **);
+extern int nios2_elf_section_letter (int, const char **);
 #define md_elf_section_flags		nios2_elf_section_flags
 extern flagword nios2_elf_section_flags (flagword, int, int);
 #endif
diff --git a/gas/config/tc-ns32k.c b/gas/config/tc-ns32k.c
index 1f5dbd9..0af829f 100644
--- a/gas/config/tc-ns32k.c
+++ b/gas/config/tc-ns32k.c
@@ -1916,7 +1916,7 @@ md_begin (void)
    LITTLENUMS emitted is stored in *SIZEP.  An error message is
    returned, or NULL on OK.  */
 
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
   return ieee_md_atof (type, litP, sizeP, FALSE);
diff --git a/gas/config/tc-or1k.c b/gas/config/tc-or1k.c
index 0abbd82..10fd2de 100644
--- a/gas/config/tc-or1k.c
+++ b/gas/config/tc-or1k.c
@@ -278,7 +278,7 @@ md_number_to_chars (char * buf, valueT val, int n)
 /* Equal to MAX_PRECISION in atof-ieee.c.  */
 #define MAX_LITTLENUMS 6
 
-char *
+const char *
 md_atof (int type, char * litP, int *  sizeP)
 {
   return ieee_md_atof (type, litP, sizeP, TRUE);
diff --git a/gas/config/tc-pdp11.c b/gas/config/tc-pdp11.c
index 68e710f..529df4f 100644
--- a/gas/config/tc-pdp11.c
+++ b/gas/config/tc-pdp11.c
@@ -30,7 +30,7 @@ extern int flonum_gen2vax (int, FLONUM_TYPE * f, LITTLENUM_TYPE *);
 /* A representation for PDP-11 machine code.  */
 struct pdp11_code
 {
-  char *error;
+  const char *error;
   int code;
   int additional;	/* Is there an additional word?  */
   int word;		/* Additional word, if any.  */
@@ -649,7 +649,7 @@ md_assemble (char *instruction_string)
   struct pdp11_code insn, op1, op2;
   int error;
   int size;
-  char *err = NULL;
+  const char *err = NULL;
   char *str;
   char *p;
   char c;
@@ -1442,7 +1442,7 @@ pseudo_even (int c ATTRIBUTE_UNUSED)
   record_alignment (now_seg, alignment);
 }
 
-char *
+const char *
 md_atof (int type, char * litP, int * sizeP)
 {
   return vax_md_atof (type, litP, sizeP);
diff --git a/gas/config/tc-pj.c b/gas/config/tc-pj.c
index 8f6266f..6a947fa 100644
--- a/gas/config/tc-pj.c
+++ b/gas/config/tc-pj.c
@@ -313,7 +313,7 @@ md_assemble (char *str)
     as_bad (_("Something forgot to clean up\n"));
 }
 
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
   return ieee_md_atof (type, litP, sizeP, target_big_endian);
diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c
index ecd251b..63e2e61 100644
--- a/gas/config/tc-ppc.c
+++ b/gas/config/tc-ppc.c
@@ -6079,7 +6079,7 @@ ppc_frob_section (asection *sec)
 
 #endif /* OBJ_XCOFF */
 \f
-char *
+const char *
 md_atof (int type, char *litp, int *sizep)
 {
   return ieee_md_atof (type, litp, sizep, target_big_endian);
diff --git a/gas/config/tc-rl78.c b/gas/config/tc-rl78.c
index d9f723a..0ecdb15 100644
--- a/gas/config/tc-rl78.c
+++ b/gas/config/tc-rl78.c
@@ -533,7 +533,7 @@ rl78_handle_align (fragS * frag)
     }
 }
 
-char *
+const char *
 md_atof (int type, char * litP, int * sizeP)
 {
   return ieee_md_atof (type, litP, sizeP, target_big_endian);
diff --git a/gas/config/tc-rx.c b/gas/config/tc-rx.c
index 22b5e9b..435d046 100644
--- a/gas/config/tc-rx.c
+++ b/gas/config/tc-rx.c
@@ -1338,7 +1338,7 @@ rx_handle_align (fragS * frag)
     }
 }
 
-char *
+const char *
 md_atof (int type, char * litP, int * sizeP)
 {
   return ieee_md_atof (type, litP, sizeP, target_big_endian);
diff --git a/gas/config/tc-s390.c b/gas/config/tc-s390.c
index 9bcc642..e2677f7 100644
--- a/gas/config/tc-s390.c
+++ b/gas/config/tc-s390.c
@@ -2034,7 +2034,7 @@ s390_machinemode (int ignore ATTRIBUTE_UNUSED)
 
 #undef MAX_HISTORY
 
-char *
+const char *
 md_atof (int type, char *litp, int *sizep)
 {
   return ieee_md_atof (type, litp, sizep, TRUE);
diff --git a/gas/config/tc-score.c b/gas/config/tc-score.c
index 536016f..8ea1084 100644
--- a/gas/config/tc-score.c
+++ b/gas/config/tc-score.c
@@ -61,7 +61,7 @@ static void s3_assemble (char *str);
 static void s3_operand (expressionS *);
 static void s3_begin (void);
 static void s3_number_to_chars (char *buf, valueT val, int n);
-static char *s3_atof (int type, char *litP, int *sizeP);
+static const char *s3_atof (int type, char *litP, int *sizeP);
 static void s3_frag_check (fragS * fragp ATTRIBUTE_UNUSED);
 static void s3_validate_fix (fixS *fixP);
 static int s3_force_relocation (struct fix *fixp);
@@ -6657,7 +6657,7 @@ s3_md_chars_to_number (char *buf, int n)
   return result;
 }
 
-static char *
+static const char *
 s3_atof (int type, char *litP, int *sizeP)
 {
   int prec;
@@ -7542,7 +7542,7 @@ md_number_to_chars (char *buf, valueT val, int n)
    within the words.  For example, (double) 1.1 in big endian mode is
    the byte sequence 3f f1 99 99 99 99 99 9a, and in little endian mode is
    the byte sequence 99 99 f1 3f 9a 99 99 99.  */
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
   if (score3)
diff --git a/gas/config/tc-sh.c b/gas/config/tc-sh.c
index ef07f10..3390a40 100644
--- a/gas/config/tc-sh.c
+++ b/gas/config/tc-sh.c
@@ -3089,7 +3089,7 @@ md_undefined_symbol (char *name ATTRIBUTE_UNUSED)
 
 /* Various routines to kill one day.  */
 
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
   return ieee_md_atof (type, litP, sizeP, target_big_endian);
diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c
index 9f30d3a..9526583 100644
--- a/gas/config/tc-sparc.c
+++ b/gas/config/tc-sparc.c
@@ -200,7 +200,7 @@ const char FLT_CHARS[] = "rRsSfFdDxXpP";
 
 struct sparc_it
   {
-    char *error;
+    const char *error;
     unsigned long opcode;
     struct nlist *nlistp;
     expressionS exp;
@@ -3234,7 +3234,7 @@ output_insn (const struct sparc_opcode *insn, struct sparc_it *theinsn)
 #endif
 }
 \f
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
   return ieee_md_atof (type, litP, sizeP, target_big_endian);
diff --git a/gas/config/tc-spu.c b/gas/config/tc-spu.c
index b658bea..13e5e2d 100644
--- a/gas/config/tc-spu.c
+++ b/gas/config/tc-spu.c
@@ -716,7 +716,7 @@ get_imm (const char *param, struct spu_insn *insn, int arg)
   return param;
 }
 
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
   return ieee_md_atof (type, litP, sizeP, TRUE);
diff --git a/gas/config/tc-tic30.c b/gas/config/tc-tic30.c
index 4ccb820..71c6249 100644
--- a/gas/config/tc-tic30.c
+++ b/gas/config/tc-tic30.c
@@ -1218,7 +1218,7 @@ md_pcrel_from (fixS *fixP)
   return fixP->fx_where - fixP->fx_size + (INSN_SIZE * offset);
 }
 
-char *
+const char *
 md_atof (int what_statement_type,
 	 char *literalP,
 	 int *sizeP)
diff --git a/gas/config/tc-tic4x.c b/gas/config/tc-tic4x.c
index a833c52..c44201d 100644
--- a/gas/config/tc-tic4x.c
+++ b/gas/config/tc-tic4x.c
@@ -2547,7 +2547,7 @@ tic4x_cleanup (void)
    of chars emitted is stored in *sizeP.  An error message is
    returned, or NULL on OK.  */
 
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
   int prec;
diff --git a/gas/config/tc-tic54x.c b/gas/config/tc-tic54x.c
index 611b537..8c33df4 100644
--- a/gas/config/tc-tic54x.c
+++ b/gas/config/tc-tic54x.c
@@ -5062,7 +5062,7 @@ tic54x_parse_name (char *name ATTRIBUTE_UNUSED,
   return 0;
 }
 
-char *
+const char *
 md_atof (int type, char *literalP, int *sizeP)
 {
   /* Target data is little-endian, but floats are stored
diff --git a/gas/config/tc-tic6x.c b/gas/config/tc-tic6x.c
index 84fd368..2135dbf 100644
--- a/gas/config/tc-tic6x.c
+++ b/gas/config/tc-tic6x.c
@@ -4078,7 +4078,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
 
 /* Convert a floating-point number to target (IEEE) format.  */
 
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
   return ieee_md_atof (type, litP, sizeP, target_big_endian);
diff --git a/gas/config/tc-tilegx.c b/gas/config/tc-tilegx.c
index 4cebfcf..bd42939 100644
--- a/gas/config/tc-tilegx.c
+++ b/gas/config/tc-tilegx.c
@@ -1330,7 +1330,7 @@ md_number_to_chars (char * buf, valueT val, int n)
    LITTLENUMS emitted is stored in *SIZEP.  An error message is
    returned, or NULL on OK.  */
 
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
   int prec;
diff --git a/gas/config/tc-tilepro.c b/gas/config/tc-tilepro.c
index 1f5890d..a11b05f 100644
--- a/gas/config/tc-tilepro.c
+++ b/gas/config/tc-tilepro.c
@@ -1205,7 +1205,7 @@ const pseudo_typeS md_pseudo_table[] =
    LITTLENUMS emitted is stored in *SIZEP.  An error message is
    returned, or NULL on OK.  */
 
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
   int prec;
diff --git a/gas/config/tc-v850.c b/gas/config/tc-v850.c
index bd762fb..5b425a9 100644
--- a/gas/config/tc-v850.c
+++ b/gas/config/tc-v850.c
@@ -1372,7 +1372,7 @@ skip_white_space (void)
    and so on upwards.  System registers are considered to be very
    high numbers.  */
 
-static char *
+static const char *
 parse_register_list (unsigned long *insn,
 		     const struct v850_operand *operand)
 {
@@ -1670,7 +1670,7 @@ md_undefined_symbol (char *name ATTRIBUTE_UNUSED)
   return 0;
 }
 
-char *
+const char *
 md_atof (int type, char *litp, int *sizep)
 {
   return ieee_md_atof (type, litp, sizep, FALSE);
diff --git a/gas/config/tc-vax.c b/gas/config/tc-vax.c
index 89fc6fc..538a994 100644
--- a/gas/config/tc-vax.c
+++ b/gas/config/tc-vax.c
@@ -3403,7 +3403,7 @@ vax_cons_fix_new (fragS *frag, int where, unsigned int nbytes, expressionS *exp,
   fix_new_exp (frag, where, (int) nbytes, exp, 0, r);
 }
 
-char *
+const char *
 md_atof (int type, char * litP, int * sizeP)
 {
   return vax_md_atof (type, litP, sizeP);
diff --git a/gas/config/tc-visium.c b/gas/config/tc-visium.c
index 4ab5fca..c618524 100644
--- a/gas/config/tc-visium.c
+++ b/gas/config/tc-visium.c
@@ -826,7 +826,7 @@ md_begin (void)
 /* Equal to MAX_PRECISION in atof-ieee.c.  */
 #define MAX_LITTLENUMS 6
 
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
   int i, prec;
diff --git a/gas/config/tc-xc16x.c b/gas/config/tc-xc16x.c
index 5e34e09..1fb964b 100644
--- a/gas/config/tc-xc16x.c
+++ b/gas/config/tc-xc16x.c
@@ -225,7 +225,7 @@ md_parse_option (int c ATTRIBUTE_UNUSED,
   return 0;
 }
 
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
   return ieee_md_atof (type, litP, sizeP, FALSE);
diff --git a/gas/config/tc-xgate.c b/gas/config/tc-xgate.c
index 5b94158..1d68edc 100644
--- a/gas/config/tc-xgate.c
+++ b/gas/config/tc-xgate.c
@@ -193,7 +193,7 @@ struct option md_longopts[] =
 
 size_t md_longopts_size = sizeof(md_longopts);
 
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
   return ieee_md_atof (type, litP, sizeP, TRUE);
diff --git a/gas/config/tc-xstormy16.c b/gas/config/tc-xstormy16.c
index 7ad3ea8..887160d 100644
--- a/gas/config/tc-xstormy16.c
+++ b/gas/config/tc-xstormy16.c
@@ -596,7 +596,7 @@ md_number_to_chars (char * buf, valueT val, int n)
   number_to_chars_littleendian (buf, val, n);
 }
 
-char *
+const char *
 md_atof (int type, char * litP, int * sizeP)
 {
   return ieee_md_atof (type, litP, sizeP, FALSE);
diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c
index fe16659..c006418 100644
--- a/gas/config/tc-xtensa.c
+++ b/gas/config/tc-xtensa.c
@@ -6073,7 +6073,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg)
 }
 
 
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
   return ieee_md_atof (type, litP, sizeP, target_big_endian);
diff --git a/gas/config/tc-z80.c b/gas/config/tc-z80.c
index 2e1dca9..7b1e72a 100644
--- a/gas/config/tc-z80.c
+++ b/gas/config/tc-z80.c
@@ -384,7 +384,7 @@ md_undefined_symbol (char *name ATTRIBUTE_UNUSED)
   return NULL;
 }
 
-char *
+const char *
 md_atof (int type ATTRIBUTE_UNUSED, char *litP ATTRIBUTE_UNUSED,
 	 int *sizeP ATTRIBUTE_UNUSED)
 {
diff --git a/gas/config/tc-z8k.c b/gas/config/tc-z8k.c
index 64fca74..6a0d596 100644
--- a/gas/config/tc-z8k.c
+++ b/gas/config/tc-z8k.c
@@ -1285,7 +1285,7 @@ md_undefined_symbol (char *name ATTRIBUTE_UNUSED)
 
 /* Various routines to kill one day.  */
 
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
   return ieee_md_atof (type, litP, sizeP, TRUE);
diff --git a/gas/messages.c b/gas/messages.c
index dc016bf..ad40ca8 100644
--- a/gas/messages.c
+++ b/gas/messages.c
@@ -342,13 +342,13 @@ sprint_value (char *buf, valueT val)
 #define HEX_MIN_THRESHOLD	-(HEX_MAX_THRESHOLD)
 
 static void
-as_internal_value_out_of_range (const char *  prefix,
-				offsetT       val,
-				offsetT       min,
-				offsetT       max,
-				const char *        file,
-				unsigned      line,
-				int           bad)
+as_internal_value_out_of_range (const char *prefix,
+				offsetT val,
+				offsetT min,
+				offsetT max,
+				const char *file,
+				unsigned line,
+				int bad)
 {
   const char * err;
 
@@ -414,22 +414,22 @@ as_internal_value_out_of_range (const char *  prefix,
 }
 
 void
-as_warn_value_out_of_range (char *   prefix,
-			   offsetT  value,
-			   offsetT  min,
-			   offsetT  max,
-			   const char *   file,
+as_warn_value_out_of_range (const char *prefix,
+			   offsetT value,
+			   offsetT min,
+			   offsetT max,
+			   const char *file,
 			   unsigned line)
 {
   as_internal_value_out_of_range (prefix, value, min, max, file, line, 0);
 }
 
 void
-as_bad_value_out_of_range (char *   prefix,
-			   offsetT  value,
-			   offsetT  min,
-			   offsetT  max,
-			   const char *   file,
+as_bad_value_out_of_range (const char *prefix,
+			   offsetT value,
+			   offsetT min,
+			   offsetT max,
+			   const char *file,
 			   unsigned line)
 {
   as_internal_value_out_of_range (prefix, value, min, max, file, line, 1);
diff --git a/gas/read.c b/gas/read.c
index 45023ca..35d44c1 100644
--- a/gas/read.c
+++ b/gas/read.c
@@ -2136,7 +2136,7 @@ s_errwarn (int err)
      self-contained message, one that can be passed like the
      demand_copy_C_string return value, and with no assumption on the
      location of the name of the directive within the message.  */
-  char *msg
+  const char *msg
     = (err ? _(".error directive invoked in source file")
        : _(".warning directive invoked in source file"));
 
@@ -3541,7 +3541,7 @@ s_float_space (int float_type)
     }
   else
     {
-      char *err;
+      const char *err;
 
       err = md_atof (float_type, temp, &flen);
       know (flen <= MAXIMUM_NUMBER_OF_CHARS_FOR_FLOAT);
@@ -4920,7 +4920,7 @@ float_cons (/* Clobbers input_line-pointer, checks end-of-line.  */
 {
   char *p;
   int length;			/* Number of chars in an object.  */
-  char *err;		/* Error from scanning floating literal.  */
+  const char *err;		/* Error from scanning floating literal.  */
   char temp[MAXIMUM_NUMBER_OF_CHARS_FOR_FLOAT];
 
   if (is_it_end_of_statement ())
diff --git a/gas/tc.h b/gas/tc.h
index 3683466..51ff499 100644
--- a/gas/tc.h
+++ b/gas/tc.h
@@ -24,7 +24,7 @@
 
 extern const pseudo_typeS md_pseudo_table[];
 
-char * md_atof (int, char *, int *);
+const char * md_atof (int, char *, int *);
 int    md_parse_option (int, const char *);
 void   md_show_usage (FILE *);
 void   md_assemble (char *);

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 7/7] enable -Wwrite-strings for gas
  2016-04-01 12:40     ` Alan Modra
@ 2016-04-01 13:10       ` Trevor Saunders
  0 siblings, 0 replies; 17+ messages in thread
From: Trevor Saunders @ 2016-04-01 13:10 UTC (permalink / raw)
  To: Alan Modra; +Cc: Jiong Wang, tbsaunde+binutils, binutils

On Fri, Apr 01, 2016 at 11:09:58PM +1030, Alan Modra wrote:
> On Fri, Apr 01, 2016 at 12:21:46PM +0100, Jiong Wang wrote:
> > This caused build failures when binutils-gdb is configured with
> > --disable-nls, for example:
> 
> Constify more

ah, nice, and thanks!

clearly I'm not awake enough yet.

Trev

> 
> 	* cgen.c (weak_operand_overflow_check): Return const char*.
> 	* messages.c (as_internal_value_out_of_range): Formatting.
> 	(as_warn_value_out_of_range): Consify prefix param.
> 	(as_bad_value_out_of_range): Likewise.
> 	* read.c (s_errwarn): Constify msg..
> 	(s_float_space, float_cons): ..and err.
> 	* as.h (as_warn_value_out_of_range, as_bad_value_out_of_range,
> 	ieee_md_atof, vax_md_atof): Update prototypes.
> 	* tc.h (md_atof): Update prototype.
> 	* config/atof-ieee.c (ieee_md_atof): Return const char*.
> 	* config/atof-vax.c (vax_md_atof): Likewise.
> 	* config/obj-elf.c (obj_elf_parse_section_letters): Constify bad_msg.
> 	* config/tc-aarch64.c (md_atof): Return const char*.
> 	* config/tc-alpha.c (s_alpha_section_name): Likewise.
> 	(s_alpha_comm): Constify sec_name.
> 	(section_name): Constify.
> 	(s_alpha_section): Consify name..
> 	(alpha_elf_section_letter): ..and ptr_msg param..
> 	(md_atof): ..and return.
> 	* config/tc-alpha.h (alpha_elf_section_letter): Update prototype.
> 	* config/tc-arc.c (md_atof): Return const char*.
> 	* config/tc-arm.c (md_atof): Likewise.
> 	* config/tc-avr.c (md_atof): Likewise.
> 	* config/tc-bfin.c (md_atof): Likewise.
> 	* config/tc-cr16.c (md_atof): Likewise.
> 	* config/tc-cris.c (md_atof): Likewise.
> 	* config/tc-crx.c (md_atof): Likewise.
> 	* config/tc-d10v.c (md_atof): Likewise.
> 	* config/tc-d30v.c (md_atof): Likewise.
> 	* config/tc-dlx.c (md_atof): Likewise.
> 	* config/tc-epiphany.c (md_atof): Likewise.
> 	* config/tc-fr30.c (md_atof): Likewise.
> 	* config/tc-frv.c (md_atof): Likewise.
> 	* config/tc-ft32.c (md_atof): Likewise.
> 	* config/tc-h8300.c (md_atof): Likewise.
> 	* config/tc-hppa.c (struct default_subspace_dict): Constify name.
> 	(struct default_space_dict): Likewise.
> 	(create_new_space): Constify name param.
> 	(create_new_subspace): Likewise.
> 	(is_defined_space, is_defined_subspace): Likewise.
> 	(pa_parse_space_stmt): Constify space_name param.
> 	(md_atof): Return const char*.
> 	(pa_spaces_begin): Constify name.
> 	* config/tc-i370.c (md_atof): Return const char*.
> 	* config/tc-i386.c (md_atof): Likewise.
> 	(x86_64_section_letter): Constify ptr_msg param.
> 	* config/tc-i386.h (x86_64_section_letter): Update prototype.
> 	* config/tc-i860.c (struct i860_it): Constify error.
> 	(md_atof): Return const char*.
> 	* config/tc-i960.c (md_atof): Likewise.
> 	* config/tc-ia64.c (md_atof): Likewise.
> 	(ia64_elf_section_letter): Constify ptr_msg param.
> 	* config/tc-ia64.h (ia64_elf_section_letter): Update prototype.
> 	* config/tc-ip2k.c (md_atof): Return const char*.
> 	* config/tc-iq2000.c (md_atof): Likewise.
> 	* config/tc-lm32.c (md_atof): Likewise.
> 	* config/tc-m32c.c (md_atof): Likewise.
> 	* config/tc-m32r.c (md_atof): Likewise.
> 	* config/tc-m68hc11.c (md_atof): Likewise.
> 	* config/tc-m68k.c (md_atof): Likewise.
> 	* config/tc-mcore.c (md_atof): Likewise.
> 	* config/tc-mep.c (md_atof): Likewise.
> 	(mep_elf_section_letter): Constify ptr_msg param.
> 	* config/tc-mep.h (mep_elf_section_letter): Update prototype.
> 	* config/tc-metag.c (md_atof): Return const char*.
> 	* config/tc-microblaze.c (md_atof): Likewise.
> 	* config/tc-microblaze.h (md_atof): Delete prototype.
> 	* config/tc-mips.c (mips_parse_argument_token): Constify err.
> 	(md_atof): Return const char*.
> 	* config/tc-mmix.c (md_atof): Likewise.
> 	* config/tc-mn10200.c (md_atof): Likewise.
> 	* config/tc-mn10300.c (md_atof): Likewise.
> 	* config/tc-moxie.c (md_atof): Likewise.
> 	* config/tc-msp430.c (md_atof): Likewise.
> 	* config/tc-mt.c (md_atof): Likewise.
> 	* config/tc-nds32.c (md_atof): Likewise.
> 	* config/tc-nios2.c (md_atof): Likewise.
> 	(nios2_elf_section_letter): Constify ptr_msg param.
> 	* config/tc-nios2.h (nios2_elf_section_letter): Update prototype.
> 	* config/tc-ns32k.c (md_atof): Return const char*.
> 	* config/tc-or1k.c (md_atof): Likewise.
> 	* config/tc-pdp11.c (struct pdp11_code): Constify error.
> 	(md_atof): Return const char*.
> 	* config/tc-pj.c (md_atof): Likewise.
> 	* config/tc-ppc.c (md_atof): Likewise.
> 	* config/tc-rl78.c (md_atof): Likewise.
> 	* config/tc-rx.c (md_atof): Likewise.
> 	* config/tc-s390.c (md_atof): Likewise.
> 	* config/tc-score.c (s3_atof, md_atof): Likewise.
> 	* config/tc-sh.c (md_atof): Likewise.
> 	* config/tc-sparc.c (struct sparc_it): Constify error.
> 	(md_atof): Return const char*.
> 	* config/tc-spu.c (md_atof): Likewise.
> 	* config/tc-tic30.c (md_atof): Likewise.
> 	* config/tc-tic4x.c (md_atof): Likewise.
> 	* config/tc-tic54x.c (md_atof): Likewise.
> 	* config/tc-tic6x.c (md_atof): Likewise.
> 	* config/tc-tilegx.c (md_atof): Likewise.
> 	* config/tc-tilepro.c (md_atof): Likewise.
> 	* config/tc-v850.c (parse_register_list, md_atof): Likewise.
> 	* config/tc-vax.c (md_atof): Likewise.
> 	* config/tc-visium.c (md_atof): Likewise.
> 	* config/tc-xc16x.c (md_atof): Likewise.
> 	* config/tc-xgate.c (md_atof): Likewise.
> 	* config/tc-xstormy16.c (md_atof): Likewise.
> 	* config/tc-xtensa.c (md_atof): Likewise.
> 	* config/tc-z80.c (md_atof): Likewise.
> 	* config/tc-z8k.c (md_atof): Likewise.
> 
> diff --git a/gas/as.h b/gas/as.h
> index ba2fb7d..9ff8bb8 100644
> --- a/gas/as.h
> +++ b/gas/as.h
> @@ -477,15 +477,15 @@ void   as_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;
>  void   sprint_value (char *, addressT);
>  int    had_errors (void);
>  int    had_warnings (void);
> -void   as_warn_value_out_of_range (char *, offsetT, offsetT, offsetT,
> +void   as_warn_value_out_of_range (const char *, offsetT, offsetT, offsetT,
>  				   const char *, unsigned);
> -void   as_bad_value_out_of_range (char *, offsetT, offsetT, offsetT,
> +void   as_bad_value_out_of_range (const char *, offsetT, offsetT, offsetT,
>  				  const char *, unsigned);
>  void   print_version_id (void);
>  char * app_push (void);
>  char * atof_ieee (char *, int, LITTLENUM_TYPE *);
> -char * ieee_md_atof (int, char *, int *, bfd_boolean);
> -char * vax_md_atof (int, char *, int *);
> +const char * ieee_md_atof (int, char *, int *, bfd_boolean);
> +const char * vax_md_atof (int, char *, int *);
>  char * input_scrub_include_file (const char *, char *);
>  void   input_scrub_insert_line (const char *);
>  void   input_scrub_insert_file (char *);
> diff --git a/gas/cgen.c b/gas/cgen.c
> index 41eaa55..c04a921 100644
> --- a/gas/cgen.c
> +++ b/gas/cgen.c
> @@ -37,7 +37,7 @@ static unsigned long gas_cgen_encode_addend
>     const unsigned long, const unsigned long, const unsigned long, \
>     const unsigned long);
>  
> -static char * weak_operand_overflow_check
> +static const char * weak_operand_overflow_check
>    (const expressionS *, const CGEN_OPERAND *);
>  
>  static void queue_fixup_recursively
> @@ -748,7 +748,7 @@ gas_cgen_encode_addend (const unsigned long start,    /* in bits */
>     overflow, so signal it by returning an error string. Any other case is
>     ambiguous, so we assume it's OK and return NULL.  */
>  
> -static char *
> +static const char *
>  weak_operand_overflow_check (const expressionS *  exp,
>  			     const CGEN_OPERAND * operand)
>  {
> diff --git a/gas/config/atof-ieee.c b/gas/config/atof-ieee.c
> index 92c367d..636549e 100644
> --- a/gas/config/atof-ieee.c
> +++ b/gas/config/atof-ieee.c
> @@ -710,7 +710,7 @@ extern const char FLT_CHARS[];
>  
>     An error message is returned, or a NULL pointer if everything went OK.  */
>  
> -char *
> +const char *
>  ieee_md_atof (int type,
>  	      char *litP,
>  	      int *sizeP,
> diff --git a/gas/config/atof-vax.c b/gas/config/atof-vax.c
> index 7c05390..8ca80b0 100644
> --- a/gas/config/atof-vax.c
> +++ b/gas/config/atof-vax.c
> @@ -387,7 +387,7 @@ flonum_gen2vax (int format_letter,	/* One of 'd' 'f' 'g' 'h'.  */
>  
>  #define MAXIMUM_NUMBER_OF_LITTLENUMS  8 	/* For .hfloats.  */
>  
> -char *
> +const char *
>  vax_md_atof (int what_statement_type,
>  	     char *literalP,
>  	     int *sizeP)
> diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c
> index 40c6e35..1d07d4b 100644
> --- a/gas/config/obj-elf.c
> +++ b/gas/config/obj-elf.c
> @@ -815,7 +815,8 @@ obj_elf_parse_section_letters (char *str, size_t len, bfd_boolean *is_clone)
>  	    }
>  	default:
>  	  {
> -	    char *bad_msg = _("unrecognized .section attribute: want a,e,w,x,M,S,G,T or number");
> +	    const char *bad_msg = _("unrecognized .section attribute:"
> +				    " want a,e,w,x,M,S,G,T or number");
>  #ifdef md_elf_section_letter
>  	    bfd_vma md_attr = md_elf_section_letter (*str, &bad_msg);
>  	    if (md_attr != (bfd_vma) -1)
> diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c
> index 0e00259..14b6011 100644
> --- a/gas/config/tc-aarch64.c
> +++ b/gas/config/tc-aarch64.c
> @@ -573,7 +573,7 @@ my_get_expression (expressionS * ep, char **str, int prefix_mode,
>     of LITTLENUMS emitted is stored in *SIZEP.  An error message is
>     returned, or NULL on OK.  */
>  
> -char *
> +const char *
>  md_atof (int type, char *litP, int *sizeP)
>  {
>    return ieee_md_atof (type, litP, sizeP, target_big_endian);
> diff --git a/gas/config/tc-alpha.c b/gas/config/tc-alpha.c
> index 5fa1403..5fe9cb6 100644
> --- a/gas/config/tc-alpha.c
> +++ b/gas/config/tc-alpha.c
> @@ -578,7 +578,7 @@ static void assemble_insn (const struct alpha_opcode *, const expressionS *, int
>  static void emit_insn (struct alpha_insn *);
>  static void assemble_tokens (const char *, const expressionS *, int, int);
>  #ifdef OBJ_EVAX
> -static char *s_alpha_section_name (void);
> +static const char *s_alpha_section_name (void);
>  static symbolS *add_to_link_pool (symbolS *, offsetT);
>  #endif
>  \f
> @@ -3552,7 +3552,7 @@ s_alpha_comm (int ignore ATTRIBUTE_UNUSED)
>           The symbol is effectively an alias for the section name.  */
>  
>        segT sec;
> -      char *sec_name;
> +      const char *sec_name;
>        symbolS *sec_symbol;
>        segT current_seg = now_seg;
>        subsegT current_subseg = now_subseg;
> @@ -4184,7 +4184,7 @@ alpha_cfi_frame_initial_instructions (void)
>  #ifdef OBJ_EVAX
>  
>  /* Get name of section.  */
> -static char *
> +static const char *
>  s_alpha_section_name (void)
>  {
>    char *name;
> @@ -4292,13 +4292,14 @@ s_alpha_section_word (char *str, size_t len)
>  
>  #define EVAX_SECTION_COUNT 5
>  
> -static char *section_name[EVAX_SECTION_COUNT + 1] =
> +static const char *section_name[EVAX_SECTION_COUNT + 1] =
>    { "NULL", ".rdata", ".comm", ".link", ".ctors", ".dtors" };
>  
>  static void
>  s_alpha_section (int secid)
>  {
> -  char *name, *beg;
> +  const char *name;
> +  char *beg;
>    segT sec;
>    flagword vms_flags = 0;
>    symbolS *symbol;
> @@ -5340,7 +5341,7 @@ select_gp_value (void)
>  /* Map 's' to SHF_ALPHA_GPREL.  */
>  
>  bfd_vma
> -alpha_elf_section_letter (int letter, char **ptr_msg)
> +alpha_elf_section_letter (int letter, const char **ptr_msg)
>  {
>    if (letter == 's')
>      return SHF_ALPHA_GPREL;
> @@ -5579,10 +5580,10 @@ md_section_align (segT seg, valueT size)
>     of LITTLENUMS emitted is stored in *SIZEP.  An error message is
>     returned, or NULL on OK.  */
>  
> -char *
> +const char *
>  md_atof (int type, char *litP, int *sizeP)
>  {
> -  extern char *vax_md_atof (int, char *, int *);
> +  extern const char *vax_md_atof (int, char *, int *);
>  
>    switch (type)
>      {
> diff --git a/gas/config/tc-alpha.h b/gas/config/tc-alpha.h
> index 326f23b..1a7badc 100644
> --- a/gas/config/tc-alpha.h
> +++ b/gas/config/tc-alpha.h
> @@ -122,7 +122,7 @@ extern void alpha_frob_file_before_adjust (void);
>  
>  #ifdef OBJ_ELF
>  #define md_elf_section_letter		alpha_elf_section_letter
> -extern bfd_vma alpha_elf_section_letter (int, char **);
> +extern bfd_vma alpha_elf_section_letter (int, const char **);
>  #define md_elf_section_flags		alpha_elf_section_flags
>  extern flagword alpha_elf_section_flags (flagword, bfd_vma, int);
>  #endif
> diff --git a/gas/config/tc-arc.c b/gas/config/tc-arc.c
> index 3f4e2d3..f3f7e26 100644
> --- a/gas/config/tc-arc.c
> +++ b/gas/config/tc-arc.c
> @@ -2848,7 +2848,7 @@ md_undefined_symbol (char *name)
>     of LITTLENUMS emitted is stored in *sizeP.  An error message is
>     returned, or NULL on OK.  */
>  
> -char *
> +const char *
>  md_atof (int type, char *litP, int *sizeP)
>  {
>    return ieee_md_atof (type, litP, sizeP, target_big_endian);
> diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
> index 2c42a13..2ccc053 100644
> --- a/gas/config/tc-arm.c
> +++ b/gas/config/tc-arm.c
> @@ -1077,7 +1077,7 @@ my_get_expression (expressionS * ep, char ** str, int prefix_mode)
>  
>     ??? The format of 12 byte floats is uncertain according to gcc's arm.h.  */
>  
> -char *
> +const char *
>  md_atof (int type, char * litP, int * sizeP)
>  {
>    int prec;
> diff --git a/gas/config/tc-avr.c b/gas/config/tc-avr.c
> index b35061e..852002f 100644
> --- a/gas/config/tc-avr.c
> +++ b/gas/config/tc-avr.c
> @@ -628,7 +628,7 @@ md_undefined_symbol (char *name ATTRIBUTE_UNUSED)
>    return NULL;
>  }
>  
> -char *
> +const char *
>  md_atof (int type, char *litP, int *sizeP)
>  {
>    return ieee_md_atof (type, litP, sizeP, FALSE);
> diff --git a/gas/config/tc-bfin.c b/gas/config/tc-bfin.c
> index 6dce28c..caa89c6 100644
> --- a/gas/config/tc-bfin.c
> +++ b/gas/config/tc-bfin.c
> @@ -798,7 +798,7 @@ md_section_align (segT segment, valueT size)
>  }
>  
>  
> -char *
> +const char *
>  md_atof (int type, char * litP, int * sizeP)
>  {
>    return ieee_md_atof (type, litP, sizeP, FALSE);
> diff --git a/gas/config/tc-cr16.c b/gas/config/tc-cr16.c
> index 45201ca..119f130 100644
> --- a/gas/config/tc-cr16.c
> +++ b/gas/config/tc-cr16.c
> @@ -715,7 +715,7 @@ md_show_usage (FILE *stream ATTRIBUTE_UNUSED)
>    return;
>  }
>  
> -char *
> +const char *
>  md_atof (int type, char *litP, int *sizeP)
>  {
>    return ieee_md_atof (type, litP, sizeP, target_big_endian);
> diff --git a/gas/config/tc-cris.c b/gas/config/tc-cris.c
> index 89343f0..536e6cb 100644
> --- a/gas/config/tc-cris.c
> +++ b/gas/config/tc-cris.c
> @@ -3591,7 +3591,7 @@ cris_get_reloc_suffix (char **cPP, bfd_reloc_code_real_type *relocp,
>     code as assembly code, but if they do, they should be able enough to
>     find out the correct bit patterns and use them.  */
>  
> -char *
> +const char *
>  md_atof (int type ATTRIBUTE_UNUSED, char *litp ATTRIBUTE_UNUSED,
>  	 int *sizep ATTRIBUTE_UNUSED)
>  {
> diff --git a/gas/config/tc-crx.c b/gas/config/tc-crx.c
> index 40a2806..7c8d7ed 100644
> --- a/gas/config/tc-crx.c
> +++ b/gas/config/tc-crx.c
> @@ -464,7 +464,7 @@ md_show_usage (FILE *stream ATTRIBUTE_UNUSED)
>    return;
>  }
>  
> -char *
> +const char *
>  md_atof (int type, char *litP, int *sizeP)
>  {
>    return ieee_md_atof (type, litP, sizeP, target_big_endian);
> diff --git a/gas/config/tc-d10v.c b/gas/config/tc-d10v.c
> index f7f213a..e2a2caa 100644
> --- a/gas/config/tc-d10v.c
> +++ b/gas/config/tc-d10v.c
> @@ -251,7 +251,7 @@ md_undefined_symbol (char *name ATTRIBUTE_UNUSED)
>    return 0;
>  }
>  
> -char *
> +const char *
>  md_atof (int type, char *litP, int *sizeP)
>  {
>    return ieee_md_atof (type, litP, sizeP, TRUE);
> diff --git a/gas/config/tc-d30v.c b/gas/config/tc-d30v.c
> index 81051f0..ae870ee 100644
> --- a/gas/config/tc-d30v.c
> +++ b/gas/config/tc-d30v.c
> @@ -285,7 +285,7 @@ md_undefined_symbol (char *name ATTRIBUTE_UNUSED)
>    return 0;
>  }
>  
> -char *
> +const char *
>  md_atof (int type, char *litP, int *sizeP)
>  {
>    return ieee_md_atof (type, litP, sizeP, TRUE);
> diff --git a/gas/config/tc-dlx.c b/gas/config/tc-dlx.c
> index 970e297..a806fe6 100644
> --- a/gas/config/tc-dlx.c
> +++ b/gas/config/tc-dlx.c
> @@ -974,7 +974,7 @@ md_assemble (char *str)
>     but I'm not sure.  Dlx will not use it anyway, so I just leave it
>     here for now.  */
>  
> -char *
> +const char *
>  md_atof (int type, char *litP, int *sizeP)
>  {
>    return ieee_md_atof (type, litP, sizeP, TRUE);
> diff --git a/gas/config/tc-epiphany.c b/gas/config/tc-epiphany.c
> index 132a78f..f35198e 100644
> --- a/gas/config/tc-epiphany.c
> +++ b/gas/config/tc-epiphany.c
> @@ -1012,7 +1012,7 @@ md_cgen_lookup_reloc (const CGEN_INSN *insn ATTRIBUTE_UNUSED,
>  /* Equal to MAX_PRECISION in atof-ieee.c.  */
>  #define MAX_LITTLENUMS 6
>  
> -char *
> +const char *
>  md_atof (int type, char *litP, int *sizeP)
>  {
>    return ieee_md_atof (type, litP, sizeP, FALSE);
> diff --git a/gas/config/tc-fr30.c b/gas/config/tc-fr30.c
> index ad3ffd0..058733b 100644
> --- a/gas/config/tc-fr30.c
> +++ b/gas/config/tc-fr30.c
> @@ -317,7 +317,7 @@ md_number_to_chars (char * buf, valueT val, int n)
>    number_to_chars_bigendian (buf, val, n);
>  }
>  
> -char *
> +const char *
>  md_atof (int type, char * litP, int * sizeP)
>  {
>    return ieee_md_atof (type, litP, sizeP, TRUE);
> diff --git a/gas/config/tc-frv.c b/gas/config/tc-frv.c
> index 24baa96..61d17a7 100644
> --- a/gas/config/tc-frv.c
> +++ b/gas/config/tc-frv.c
> @@ -1513,7 +1513,7 @@ frv_md_number_to_chars (char *buf, valueT val, int n)
>    number_to_chars_bigendian (buf, val, n);
>  }
>  
> -char *
> +const char *
>  md_atof (int type, char *litP, int *sizeP)
>  {
>    return ieee_md_atof (type, litP, sizeP, TRUE);
> diff --git a/gas/config/tc-ft32.c b/gas/config/tc-ft32.c
> index 327b393..56c0a68 100644
> --- a/gas/config/tc-ft32.c
> +++ b/gas/config/tc-ft32.c
> @@ -408,7 +408,7 @@ md_assemble (char *str)
>     of LITTLENUMS emitted is stored in *SIZEP .  An error message is
>     returned, or NULL on OK.  */
>  
> -char *
> +const char *
>  md_atof (int type, char *litP, int *sizeP)
>  {
>    int prec;
> diff --git a/gas/config/tc-h8300.c b/gas/config/tc-h8300.c
> index f50f497..edca456 100644
> --- a/gas/config/tc-h8300.c
> +++ b/gas/config/tc-h8300.c
> @@ -2101,7 +2101,7 @@ md_undefined_symbol (char *name ATTRIBUTE_UNUSED)
>  
>  /* Various routines to kill one day.  */
>  
> -char *
> +const char *
>  md_atof (int type, char *litP, int *sizeP)
>  {
>    return ieee_md_atof (type, litP, sizeP, TRUE);
> diff --git a/gas/config/tc-hppa.c b/gas/config/tc-hppa.c
> index c2001bd..82d33c2 100644
> --- a/gas/config/tc-hppa.c
> +++ b/gas/config/tc-hppa.c
> @@ -350,7 +350,7 @@ typedef struct space_dictionary_chain sd_chain_struct;
>  struct default_subspace_dict
>    {
>      /* Name of the subspace.  */
> -    char *name;
> +    const char *name;
>  
>      /* FIXME.  Is this still needed?  */
>      char defined;
> @@ -403,7 +403,7 @@ struct default_subspace_dict
>  struct default_space_dict
>    {
>      /* Name of the space.  */
> -    char *name;
> +    const char *name;
>  
>      /* Space number.  It is possible to identify spaces within
>         assembly code numerically!  */
> @@ -503,27 +503,27 @@ static void pa_align (int);
>  static void pa_space (int);
>  static void pa_spnum (int);
>  static void pa_subspace (int);
> -static sd_chain_struct *create_new_space (char *, int, int,
> -						  int, int, int,
> -						  asection *, int);
> +static sd_chain_struct *create_new_space (const char *, int, int,
> +					  int, int, int,
> +					  asection *, int);
>  static ssd_chain_struct *create_new_subspace (sd_chain_struct *,
> -						      char *, int, int,
> -						      int, int, int, int,
> -						      int, int, int, int,
> -						      int, asection *);
> +					      const char *, int, int,
> +					      int, int, int, int,
> +					      int, int, int, int,
> +					      int, asection *);
>  static ssd_chain_struct *update_subspace (sd_chain_struct *,
> -						  char *, int, int, int,
> -						  int, int, int, int,
> -						  int, int, int, int,
> -						  asection *);
> -static sd_chain_struct *is_defined_space (char *);
> -static ssd_chain_struct *is_defined_subspace (char *);
> +					  char *, int, int, int,
> +					  int, int, int, int,
> +					  int, int, int, int,
> +					  asection *);
> +static sd_chain_struct *is_defined_space (const char *);
> +static ssd_chain_struct *is_defined_subspace (const char *);
>  static sd_chain_struct *pa_segment_to_space (asection *);
>  static ssd_chain_struct *pa_subsegment_to_subspace (asection *,
>  							    subsegT);
>  static sd_chain_struct *pa_find_space_by_number (int);
>  static unsigned int pa_subspace_start (sd_chain_struct *, int);
> -static sd_chain_struct *pa_parse_space_stmt (char *, int);
> +static sd_chain_struct *pa_parse_space_stmt (const char *, int);
>  #endif
>  
>  /* File and globally scoped variable declarations.  */
> @@ -1319,7 +1319,7 @@ pa_parse_nullif (char **s)
>    return nullif;
>  }
>  
> -char *
> +const char *
>  md_atof (int type, char *litP, int *sizeP)
>  {
>    return ieee_md_atof (type, litP, sizeP, TRUE);
> @@ -7080,7 +7080,7 @@ pa_check_current_space_and_subspace (void)
>     by the parameters to the .SPACE directive.  */
>  
>  static sd_chain_struct *
> -pa_parse_space_stmt (char *space_name, int create_flag)
> +pa_parse_space_stmt (const char *space_name, int create_flag)
>  {
>    char *name, *ptemp, c;
>    char loadable, defined, private, sort;
> @@ -7590,7 +7590,7 @@ pa_spaces_begin (void)
>    i = 0;
>    while (pa_def_spaces[i].name)
>      {
> -      char *name;
> +      const char *name;
>  
>        /* Pick the right name to use for the new section.  */
>        name = pa_def_spaces[i].name;
> @@ -7606,7 +7606,7 @@ pa_spaces_begin (void)
>    i = 0;
>    while (pa_def_subspaces[i].name)
>      {
> -      char *name;
> +      const char *name;
>        int applicable, subsegment;
>        asection *segment = NULL;
>        sd_chain_struct *space;
> @@ -7707,7 +7707,7 @@ pa_spaces_begin (void)
>     by the given parameters.  */
>  
>  static sd_chain_struct *
> -create_new_space (char *name,
> +create_new_space (const char *name,
>  		  int spnum,
>  		  int loadable ATTRIBUTE_UNUSED,
>  		  int defined,
> @@ -7789,7 +7789,7 @@ create_new_space (char *name,
>  
>  static ssd_chain_struct *
>  create_new_subspace (sd_chain_struct *space,
> -		     char *name,
> +		     const char *name,
>  		     int loadable ATTRIBUTE_UNUSED,
>  		     int code_only ATTRIBUTE_UNUSED,
>  		     int comdat,
> @@ -7893,7 +7893,7 @@ update_subspace (sd_chain_struct *space,
>     NULL if no such space exists.  */
>  
>  static sd_chain_struct *
> -is_defined_space (char *name)
> +is_defined_space (const char *name)
>  {
>    sd_chain_struct *chain_pointer;
>  
> @@ -7942,7 +7942,7 @@ pa_segment_to_space (asection *seg)
>     own subspace.  */
>  
>  static ssd_chain_struct *
> -is_defined_subspace (char *name)
> +is_defined_subspace (const char *name)
>  {
>    sd_chain_struct *space_chain;
>    ssd_chain_struct *subspace_chain;
> diff --git a/gas/config/tc-i370.c b/gas/config/tc-i370.c
> index 1b419e8..7e2f146 100644
> --- a/gas/config/tc-i370.c
> +++ b/gas/config/tc-i370.c
> @@ -2352,7 +2352,7 @@ i370_tc (int ignore ATTRIBUTE_UNUSED)
>      }
>  }
>  \f
> -char *
> +const char *
>  md_atof (int type, char *litp, int *sizep)
>  {
>    /* 360/370/390 have two float formats: an old, funky 360 single-precision
> diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
> index 55ca5c3..ce5304d 100644
> --- a/gas/config/tc-i386.c
> +++ b/gas/config/tc-i386.c
> @@ -9378,7 +9378,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
>    md_number_to_chars (p, value, fixP->fx_size);
>  }
>  \f
> -char *
> +const char *
>  md_atof (int type, char *litP, int *sizeP)
>  {
>    /* This outputs the LITTLENUMs in REVERSE order;
> @@ -10781,7 +10781,7 @@ tc_pe_dwarf2_emit_offset (symbolS *symbol, unsigned int size)
>  /* For ELF on x86-64, add support for SHF_X86_64_LARGE.  */
>  
>  bfd_vma
> -x86_64_section_letter (int letter, char **ptr_msg)
> +x86_64_section_letter (int letter, const char **ptr_msg)
>  {
>    if (flag_code == CODE_64BIT)
>      {
> diff --git a/gas/config/tc-i386.h b/gas/config/tc-i386.h
> index 006dacb..7a987d8 100644
> --- a/gas/config/tc-i386.h
> +++ b/gas/config/tc-i386.h
> @@ -310,7 +310,7 @@ extern void i386_solaris_fix_up_eh_frame (segT);
>  
>  /* Support for SHF_X86_64_LARGE */
>  extern bfd_vma x86_64_section_word (char *, size_t);
> -extern bfd_vma x86_64_section_letter (int, char **);
> +extern bfd_vma x86_64_section_letter (int, const char **);
>  #define md_elf_section_letter(LETTER, PTR_MSG)	x86_64_section_letter (LETTER, PTR_MSG)
>  #define md_elf_section_word(STR, LEN)		x86_64_section_word (STR, LEN)
>  
> diff --git a/gas/config/tc-i860.c b/gas/config/tc-i860.c
> index ea21669..85855e9 100644
> --- a/gas/config/tc-i860.c
> +++ b/gas/config/tc-i860.c
> @@ -53,7 +53,7 @@ static char reg_prefix;
>  
>  struct i860_it
>  {
> -  char *error;
> +  const char *error;
>    unsigned long opcode;
>    enum expand_type expand;
>    struct i860_fi
> @@ -1010,7 +1010,7 @@ i860_get_expression (char *str)
>    return 0;
>  }
>  
> -char *
> +const char *
>  md_atof (int type, char *litP, int *sizeP)
>  {
>    return ieee_md_atof (type, litP, sizeP, TRUE);
> diff --git a/gas/config/tc-i960.c b/gas/config/tc-i960.c
> index 667ab4c..1335da1 100644
> --- a/gas/config/tc-i960.c
> +++ b/gas/config/tc-i960.c
> @@ -1707,7 +1707,7 @@ md_number_to_chars (char *buf,
>    number_to_chars_littleendian (buf, value, n);
>  }
>  
> -char *
> +const char *
>  md_atof (int type, char *litP, int *sizeP)
>  {
>    return ieee_md_atof (type, litP, sizeP, FALSE);
> diff --git a/gas/config/tc-ia64.c b/gas/config/tc-ia64.c
> index a50b61e..8da09e0 100644
> --- a/gas/config/tc-ia64.c
> +++ b/gas/config/tc-ia64.c
> @@ -856,7 +856,7 @@ set_section (char *name)
>  /* Map 's' to SHF_IA_64_SHORT.  */
>  
>  bfd_vma
> -ia64_elf_section_letter (int letter, char **ptr_msg)
> +ia64_elf_section_letter (int letter, const char **ptr_msg)
>  {
>    if (letter == 's')
>      return SHF_IA_64_SHORT;
> @@ -11576,7 +11576,7 @@ tc_gen_reloc (asection *sec ATTRIBUTE_UNUSED, fixS *fixp)
>  
>  #define MAX_LITTLENUMS 5
>  
> -char *
> +const char *
>  md_atof (int type, char *lit, int *size)
>  {
>    LITTLENUM_TYPE words[MAX_LITTLENUMS];
> diff --git a/gas/config/tc-ia64.h b/gas/config/tc-ia64.h
> index 4858c27..dcf07ec 100644
> --- a/gas/config/tc-ia64.h
> +++ b/gas/config/tc-ia64.h
> @@ -110,7 +110,7 @@ extern void ia64_cons_fix_new (fragS *, int, int, expressionS *,
>  			       bfd_reloc_code_real_type);
>  extern void ia64_validate_fix (struct fix *);
>  extern char * ia64_canonicalize_symbol_name (char *);
> -extern bfd_vma ia64_elf_section_letter (int, char **);
> +extern bfd_vma ia64_elf_section_letter (int, const char **);
>  extern flagword ia64_elf_section_flags (flagword, bfd_vma, int);
>  extern int ia64_elf_section_type (const char *, size_t);
>  extern long ia64_pcrel_from_section (struct fix *, segT);
> diff --git a/gas/config/tc-ip2k.c b/gas/config/tc-ip2k.c
> index 7e4d351..642dfea 100644
> --- a/gas/config/tc-ip2k.c
> +++ b/gas/config/tc-ip2k.c
> @@ -311,7 +311,7 @@ md_number_to_chars (char * buf, valueT val, int n)
>    number_to_chars_bigendian (buf, val, n);
>  }
>  
> -char *
> +const char *
>  md_atof (int type, char * litP, int *  sizeP)
>  {
>    return ieee_md_atof (type, litP, sizeP, TRUE);
> diff --git a/gas/config/tc-iq2000.c b/gas/config/tc-iq2000.c
> index c5ccfca..f1f7945 100644
> --- a/gas/config/tc-iq2000.c
> +++ b/gas/config/tc-iq2000.c
> @@ -724,7 +724,7 @@ md_operand (expressionS * exp)
>      gas_cgen_md_operand (exp);
>  }
>  
> -char *
> +const char *
>  md_atof (int type, char * litP, int * sizeP)
>  {
>    return ieee_md_atof (type, litP, sizeP, TRUE);
> diff --git a/gas/config/tc-lm32.c b/gas/config/tc-lm32.c
> index a20b9a0..5f7d703 100644
> --- a/gas/config/tc-lm32.c
> +++ b/gas/config/tc-lm32.c
> @@ -214,7 +214,7 @@ md_number_to_chars (char * buf, valueT val, int n)
>     of LITTLENUMS emitted is stored in *SIZEP.  An error message is
>     returned, or NULL on OK.  */
>  
> -char *
> +const char *
>  md_atof (int type, char *litP, int *sizeP)
>  {
>    int i;
> diff --git a/gas/config/tc-m32c.c b/gas/config/tc-m32c.c
> index 5496f7e..0219d9b 100644
> --- a/gas/config/tc-m32c.c
> +++ b/gas/config/tc-m32c.c
> @@ -1155,7 +1155,7 @@ md_number_to_chars (char * buf, valueT val, int n)
>  /* Equal to MAX_PRECISION in atof-ieee.c.  */
>  #define MAX_LITTLENUMS 6
>  
> -char *
> +const char *
>  md_atof (int type, char * litP, int * sizeP)
>  {
>    return ieee_md_atof (type, litP, sizeP, TRUE);
> diff --git a/gas/config/tc-m32r.c b/gas/config/tc-m32r.c
> index 89205f8..126ab9c 100644
> --- a/gas/config/tc-m32r.c
> +++ b/gas/config/tc-m32r.c
> @@ -2106,7 +2106,7 @@ md_number_to_chars (char *buf, valueT val, int n)
>  /* Equal to MAX_PRECISION in atof-ieee.c.  */
>  #define MAX_LITTLENUMS 6
>  
> -char *
> +const char *
>  md_atof (int type, char *litP, int *sizeP)
>  {
>    return ieee_md_atof (type, litP, sizeP, target_big_endian);
> diff --git a/gas/config/tc-m68hc11.c b/gas/config/tc-m68hc11.c
> index 71fdb26..c61bded 100644
> --- a/gas/config/tc-m68hc11.c
> +++ b/gas/config/tc-m68hc11.c
> @@ -574,7 +574,7 @@ md_undefined_symbol (char *name ATTRIBUTE_UNUSED)
>    return 0;
>  }
>  
> -char *
> +const char *
>  md_atof (int type, char *litP, int *sizeP)
>  {
>    return ieee_md_atof (type, litP, sizeP, TRUE);
> diff --git a/gas/config/tc-m68k.c b/gas/config/tc-m68k.c
> index b89f0a9..f148845 100644
> --- a/gas/config/tc-m68k.c
> +++ b/gas/config/tc-m68k.c
> @@ -4879,7 +4879,7 @@ m68k_mri_mode_change (int on)
>      }
>  }
>  
> -char *
> +const char *
>  md_atof (int type, char *litP, int *sizeP)
>  {
>    return ieee_md_atof (type, litP, sizeP, TRUE);
> diff --git a/gas/config/tc-mcore.c b/gas/config/tc-mcore.c
> index dc5c95d..67d1ea8 100644
> --- a/gas/config/tc-mcore.c
> +++ b/gas/config/tc-mcore.c
> @@ -1616,7 +1616,7 @@ md_mcore_end (void)
>  
>  /* Various routines to kill one day.  */
>  
> -char *
> +const char *
>  md_atof (int type, char * litP, int * sizeP)
>  {
>    return ieee_md_atof (type, litP, sizeP, target_big_endian);
> diff --git a/gas/config/tc-mep.c b/gas/config/tc-mep.c
> index 6b659d4..6e62ad5 100644
> --- a/gas/config/tc-mep.c
> +++ b/gas/config/tc-mep.c
> @@ -2039,7 +2039,7 @@ md_number_to_chars (char *buf, valueT val, int n)
>      number_to_chars_littleendian (buf, val, n);
>  }
>  
> -char *
> +const char *
>  md_atof (int type, char *litP, int *sizeP)
>  {
>    return ieee_md_atof (type, litP, sizeP, TRUE);
> @@ -2080,7 +2080,7 @@ mep_fix_adjustable (fixS *fixP)
>  }
>  
>  bfd_vma
> -mep_elf_section_letter (int letter, char **ptrmsg)
> +mep_elf_section_letter (int letter, const char **ptrmsg)
>  {
>    if (letter == 'v')
>      return SHF_MEP_VLIW;
> diff --git a/gas/config/tc-mep.h b/gas/config/tc-mep.h
> index c771c21..b711889 100644
> --- a/gas/config/tc-mep.h
> +++ b/gas/config/tc-mep.h
> @@ -106,7 +106,7 @@ extern int mep_unrecognized_line (int);
>  extern void mep_cleanup (void);
>  
>  #define md_elf_section_letter		mep_elf_section_letter
> -extern bfd_vma mep_elf_section_letter (int, char **);
> +extern bfd_vma mep_elf_section_letter (int, const char **);
>  #define md_elf_section_flags		mep_elf_section_flags
>  extern flagword mep_elf_section_flags  (flagword, bfd_vma, int);
>  
> diff --git a/gas/config/tc-metag.c b/gas/config/tc-metag.c
> index d287387..cc9140b 100644
> --- a/gas/config/tc-metag.c
> +++ b/gas/config/tc-metag.c
> @@ -6707,7 +6707,7 @@ md_number_to_chars (char * buf, valueT val, int n)
>  /* Equal to MAX_PRECISION in atof-ieee.c */
>  #define MAX_LITTLENUMS 6
>  
> -char *
> +const char *
>  md_atof (int type, char * litP, int * sizeP)
>  {
>    int              i;
> diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c
> index a92e0eb..e720ee8 100644
> --- a/gas/config/tc-microblaze.c
> +++ b/gas/config/tc-microblaze.c
> @@ -1758,7 +1758,7 @@ md_undefined_symbol (char * name ATTRIBUTE_UNUSED)
>  /* Turn a string in input_line_pointer into a floating point constant of type
>     type, and store the appropriate bytes in *litP.  The number of LITTLENUMS
>     emitted is stored in *sizeP.  An error message is returned, or NULL on OK.*/
> -char *
> +const char *
>  md_atof (int type, char * litP, int * sizeP)
>  {
>    int prec;
> diff --git a/gas/config/tc-microblaze.h b/gas/config/tc-microblaze.h
> index 0fde831..f298a2a 100644
> --- a/gas/config/tc-microblaze.h
> +++ b/gas/config/tc-microblaze.h
> @@ -100,7 +100,6 @@ extern const struct relax_type md_relax_table[];
>  extern void      md_begin            (void);
>  extern void      md_assemble         (char *);
>  extern symbolS * md_undefined_symbol (char *);
> -extern char *    md_atof             (int, char *, int *);
>  extern void      md_show_usage       (FILE *);
>  extern void      md_convert_frag               (bfd *, segT, fragS *);
>  extern void      md_operand                    (expressionS *);
> diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
> index f2b81f2..ca1098b 100644
> --- a/gas/config/tc-mips.c
> +++ b/gas/config/tc-mips.c
> @@ -3042,7 +3042,8 @@ mips_parse_base_start (char *s)
>  static char *
>  mips_parse_argument_token (char *s, char float_format)
>  {
> -  char *end, *save_in, *err;
> +  char *end, *save_in;
> +  const char *err;
>    unsigned int regno1, regno2, channels;
>    struct mips_operand_token token;
>  
> @@ -13996,7 +13997,7 @@ my_getExpression (expressionS *ep, char *str)
>    input_line_pointer = save_in;
>  }
>  
> -char *
> +const char *
>  md_atof (int type, char *litP, int *sizeP)
>  {
>    return ieee_md_atof (type, litP, sizeP, target_big_endian);
> diff --git a/gas/config/tc-mmix.c b/gas/config/tc-mmix.c
> index 00543f4..2400a0b 100644
> --- a/gas/config/tc-mmix.c
> +++ b/gas/config/tc-mmix.c
> @@ -2272,7 +2272,7 @@ md_estimate_size_before_relax (fragS *fragP, segT segment)
>     emitted is stored in *sizeP .  An error message is returned, or NULL on
>     OK.  */
>  
> -char *
> +const char *
>  md_atof (int type, char *litP, int *sizeP)
>  {
>    if (type == 'r')
> diff --git a/gas/config/tc-mn10200.c b/gas/config/tc-mn10200.c
> index ea2fa8f..2cdfa68 100644
> --- a/gas/config/tc-mn10200.c
> +++ b/gas/config/tc-mn10200.c
> @@ -314,7 +314,7 @@ md_undefined_symbol (char *name ATTRIBUTE_UNUSED)
>    return 0;
>  }
>  
> -char *
> +const char *
>  md_atof (int type, char *litp, int *sizep)
>  {
>    return ieee_md_atof (type, litp, sizep, FALSE);
> diff --git a/gas/config/tc-mn10300.c b/gas/config/tc-mn10300.c
> index 4f76677..9a5d3be 100644
> --- a/gas/config/tc-mn10300.c
> +++ b/gas/config/tc-mn10300.c
> @@ -455,7 +455,7 @@ md_undefined_symbol (char *name ATTRIBUTE_UNUSED)
>    return 0;
>  }
>  
> -char *
> +const char *
>  md_atof (int type, char *litp, int *sizep)
>  {
>    return ieee_md_atof (type, litp, sizep, FALSE);
> diff --git a/gas/config/tc-moxie.c b/gas/config/tc-moxie.c
> index aa48c99..24c9aec 100644
> --- a/gas/config/tc-moxie.c
> +++ b/gas/config/tc-moxie.c
> @@ -556,7 +556,7 @@ md_assemble (char *str)
>     of LITTLENUMS emitted is stored in *SIZEP .  An error message is
>     returned, or NULL on OK.  */
>  
> -char *
> +const char *
>  md_atof (int type, char *litP, int *sizeP)
>  {
>    int prec;
> diff --git a/gas/config/tc-msp430.c b/gas/config/tc-msp430.c
> index 98910aa..3621fdb 100644
> --- a/gas/config/tc-msp430.c
> +++ b/gas/config/tc-msp430.c
> @@ -1630,7 +1630,7 @@ extract_cmd (char * from, char * to, int limit)
>    return from;
>  }
>  
> -char *
> +const char *
>  md_atof (int type, char * litP, int * sizeP)
>  {
>    return ieee_md_atof (type, litP, sizeP, FALSE);
> diff --git a/gas/config/tc-mt.c b/gas/config/tc-mt.c
> index c9aa18c..e0bca88 100644
> --- a/gas/config/tc-mt.c
> +++ b/gas/config/tc-mt.c
> @@ -433,7 +433,7 @@ md_number_to_chars (char * buf, valueT val, int n)
>    number_to_chars_bigendian (buf, val, n);
>  }
>  
> -char *
> +const char *
>  md_atof (int type, char * litP, int * sizeP)
>  {
>    return ieee_md_atof (type, litP, sizeP, FALSE);
> diff --git a/gas/config/tc-nds32.c b/gas/config/tc-nds32.c
> index 0d7d346..897561d 100644
> --- a/gas/config/tc-nds32.c
> +++ b/gas/config/tc-nds32.c
> @@ -6064,7 +6064,7 @@ md_number_to_chars (char *buf, valueT val, int n)
>  /* This function is called to convert an ASCII string into a floating point
>     value in format used by the CPU.  */
>  
> -char *
> +const char *
>  md_atof (int type, char *litP, int *sizeP)
>  {
>    int i;
> diff --git a/gas/config/tc-nios2.c b/gas/config/tc-nios2.c
> index 399fcf0..bf37ff7 100644
> --- a/gas/config/tc-nios2.c
> +++ b/gas/config/tc-nios2.c
> @@ -264,7 +264,7 @@ md_number_to_chars (char *buf, valueT val, int n)
>     of type TYPE, and store the appropriate bytes in *LITP.  The number
>     of LITTLENUMS emitted is stored in *SIZEP.  An error message is
>     returned, or NULL on OK.  */
> -char *
> +const char *
>  md_atof (int type, char *litP, int *sizeP)
>  {
>    int prec;
> @@ -3980,7 +3980,7 @@ nios2_cons_align (int size)
>  /* Map 's' to SHF_NIOS2_GPREL.  */
>  /* This is from the Alpha code tc-alpha.c.  */
>  int
> -nios2_elf_section_letter (int letter, char **ptr_msg)
> +nios2_elf_section_letter (int letter, const char **ptr_msg)
>  {
>    if (letter == 's')
>      return SHF_NIOS2_GPREL;
> diff --git a/gas/config/tc-nios2.h b/gas/config/tc-nios2.h
> index 05cc596..3612c33 100644
> --- a/gas/config/tc-nios2.h
> +++ b/gas/config/tc-nios2.h
> @@ -92,7 +92,7 @@ extern long nios2_relax_frag (segT segment, fragS * fragP, long stretch);
>  
>  /* Processor-specific section directives.  */
>  #define md_elf_section_letter		nios2_elf_section_letter
> -extern int nios2_elf_section_letter (int, char **);
> +extern int nios2_elf_section_letter (int, const char **);
>  #define md_elf_section_flags		nios2_elf_section_flags
>  extern flagword nios2_elf_section_flags (flagword, int, int);
>  #endif
> diff --git a/gas/config/tc-ns32k.c b/gas/config/tc-ns32k.c
> index 1f5dbd9..0af829f 100644
> --- a/gas/config/tc-ns32k.c
> +++ b/gas/config/tc-ns32k.c
> @@ -1916,7 +1916,7 @@ md_begin (void)
>     LITTLENUMS emitted is stored in *SIZEP.  An error message is
>     returned, or NULL on OK.  */
>  
> -char *
> +const char *
>  md_atof (int type, char *litP, int *sizeP)
>  {
>    return ieee_md_atof (type, litP, sizeP, FALSE);
> diff --git a/gas/config/tc-or1k.c b/gas/config/tc-or1k.c
> index 0abbd82..10fd2de 100644
> --- a/gas/config/tc-or1k.c
> +++ b/gas/config/tc-or1k.c
> @@ -278,7 +278,7 @@ md_number_to_chars (char * buf, valueT val, int n)
>  /* Equal to MAX_PRECISION in atof-ieee.c.  */
>  #define MAX_LITTLENUMS 6
>  
> -char *
> +const char *
>  md_atof (int type, char * litP, int *  sizeP)
>  {
>    return ieee_md_atof (type, litP, sizeP, TRUE);
> diff --git a/gas/config/tc-pdp11.c b/gas/config/tc-pdp11.c
> index 68e710f..529df4f 100644
> --- a/gas/config/tc-pdp11.c
> +++ b/gas/config/tc-pdp11.c
> @@ -30,7 +30,7 @@ extern int flonum_gen2vax (int, FLONUM_TYPE * f, LITTLENUM_TYPE *);
>  /* A representation for PDP-11 machine code.  */
>  struct pdp11_code
>  {
> -  char *error;
> +  const char *error;
>    int code;
>    int additional;	/* Is there an additional word?  */
>    int word;		/* Additional word, if any.  */
> @@ -649,7 +649,7 @@ md_assemble (char *instruction_string)
>    struct pdp11_code insn, op1, op2;
>    int error;
>    int size;
> -  char *err = NULL;
> +  const char *err = NULL;
>    char *str;
>    char *p;
>    char c;
> @@ -1442,7 +1442,7 @@ pseudo_even (int c ATTRIBUTE_UNUSED)
>    record_alignment (now_seg, alignment);
>  }
>  
> -char *
> +const char *
>  md_atof (int type, char * litP, int * sizeP)
>  {
>    return vax_md_atof (type, litP, sizeP);
> diff --git a/gas/config/tc-pj.c b/gas/config/tc-pj.c
> index 8f6266f..6a947fa 100644
> --- a/gas/config/tc-pj.c
> +++ b/gas/config/tc-pj.c
> @@ -313,7 +313,7 @@ md_assemble (char *str)
>      as_bad (_("Something forgot to clean up\n"));
>  }
>  
> -char *
> +const char *
>  md_atof (int type, char *litP, int *sizeP)
>  {
>    return ieee_md_atof (type, litP, sizeP, target_big_endian);
> diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c
> index ecd251b..63e2e61 100644
> --- a/gas/config/tc-ppc.c
> +++ b/gas/config/tc-ppc.c
> @@ -6079,7 +6079,7 @@ ppc_frob_section (asection *sec)
>  
>  #endif /* OBJ_XCOFF */
>  \f
> -char *
> +const char *
>  md_atof (int type, char *litp, int *sizep)
>  {
>    return ieee_md_atof (type, litp, sizep, target_big_endian);
> diff --git a/gas/config/tc-rl78.c b/gas/config/tc-rl78.c
> index d9f723a..0ecdb15 100644
> --- a/gas/config/tc-rl78.c
> +++ b/gas/config/tc-rl78.c
> @@ -533,7 +533,7 @@ rl78_handle_align (fragS * frag)
>      }
>  }
>  
> -char *
> +const char *
>  md_atof (int type, char * litP, int * sizeP)
>  {
>    return ieee_md_atof (type, litP, sizeP, target_big_endian);
> diff --git a/gas/config/tc-rx.c b/gas/config/tc-rx.c
> index 22b5e9b..435d046 100644
> --- a/gas/config/tc-rx.c
> +++ b/gas/config/tc-rx.c
> @@ -1338,7 +1338,7 @@ rx_handle_align (fragS * frag)
>      }
>  }
>  
> -char *
> +const char *
>  md_atof (int type, char * litP, int * sizeP)
>  {
>    return ieee_md_atof (type, litP, sizeP, target_big_endian);
> diff --git a/gas/config/tc-s390.c b/gas/config/tc-s390.c
> index 9bcc642..e2677f7 100644
> --- a/gas/config/tc-s390.c
> +++ b/gas/config/tc-s390.c
> @@ -2034,7 +2034,7 @@ s390_machinemode (int ignore ATTRIBUTE_UNUSED)
>  
>  #undef MAX_HISTORY
>  
> -char *
> +const char *
>  md_atof (int type, char *litp, int *sizep)
>  {
>    return ieee_md_atof (type, litp, sizep, TRUE);
> diff --git a/gas/config/tc-score.c b/gas/config/tc-score.c
> index 536016f..8ea1084 100644
> --- a/gas/config/tc-score.c
> +++ b/gas/config/tc-score.c
> @@ -61,7 +61,7 @@ static void s3_assemble (char *str);
>  static void s3_operand (expressionS *);
>  static void s3_begin (void);
>  static void s3_number_to_chars (char *buf, valueT val, int n);
> -static char *s3_atof (int type, char *litP, int *sizeP);
> +static const char *s3_atof (int type, char *litP, int *sizeP);
>  static void s3_frag_check (fragS * fragp ATTRIBUTE_UNUSED);
>  static void s3_validate_fix (fixS *fixP);
>  static int s3_force_relocation (struct fix *fixp);
> @@ -6657,7 +6657,7 @@ s3_md_chars_to_number (char *buf, int n)
>    return result;
>  }
>  
> -static char *
> +static const char *
>  s3_atof (int type, char *litP, int *sizeP)
>  {
>    int prec;
> @@ -7542,7 +7542,7 @@ md_number_to_chars (char *buf, valueT val, int n)
>     within the words.  For example, (double) 1.1 in big endian mode is
>     the byte sequence 3f f1 99 99 99 99 99 9a, and in little endian mode is
>     the byte sequence 99 99 f1 3f 9a 99 99 99.  */
> -char *
> +const char *
>  md_atof (int type, char *litP, int *sizeP)
>  {
>    if (score3)
> diff --git a/gas/config/tc-sh.c b/gas/config/tc-sh.c
> index ef07f10..3390a40 100644
> --- a/gas/config/tc-sh.c
> +++ b/gas/config/tc-sh.c
> @@ -3089,7 +3089,7 @@ md_undefined_symbol (char *name ATTRIBUTE_UNUSED)
>  
>  /* Various routines to kill one day.  */
>  
> -char *
> +const char *
>  md_atof (int type, char *litP, int *sizeP)
>  {
>    return ieee_md_atof (type, litP, sizeP, target_big_endian);
> diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c
> index 9f30d3a..9526583 100644
> --- a/gas/config/tc-sparc.c
> +++ b/gas/config/tc-sparc.c
> @@ -200,7 +200,7 @@ const char FLT_CHARS[] = "rRsSfFdDxXpP";
>  
>  struct sparc_it
>    {
> -    char *error;
> +    const char *error;
>      unsigned long opcode;
>      struct nlist *nlistp;
>      expressionS exp;
> @@ -3234,7 +3234,7 @@ output_insn (const struct sparc_opcode *insn, struct sparc_it *theinsn)
>  #endif
>  }
>  \f
> -char *
> +const char *
>  md_atof (int type, char *litP, int *sizeP)
>  {
>    return ieee_md_atof (type, litP, sizeP, target_big_endian);
> diff --git a/gas/config/tc-spu.c b/gas/config/tc-spu.c
> index b658bea..13e5e2d 100644
> --- a/gas/config/tc-spu.c
> +++ b/gas/config/tc-spu.c
> @@ -716,7 +716,7 @@ get_imm (const char *param, struct spu_insn *insn, int arg)
>    return param;
>  }
>  
> -char *
> +const char *
>  md_atof (int type, char *litP, int *sizeP)
>  {
>    return ieee_md_atof (type, litP, sizeP, TRUE);
> diff --git a/gas/config/tc-tic30.c b/gas/config/tc-tic30.c
> index 4ccb820..71c6249 100644
> --- a/gas/config/tc-tic30.c
> +++ b/gas/config/tc-tic30.c
> @@ -1218,7 +1218,7 @@ md_pcrel_from (fixS *fixP)
>    return fixP->fx_where - fixP->fx_size + (INSN_SIZE * offset);
>  }
>  
> -char *
> +const char *
>  md_atof (int what_statement_type,
>  	 char *literalP,
>  	 int *sizeP)
> diff --git a/gas/config/tc-tic4x.c b/gas/config/tc-tic4x.c
> index a833c52..c44201d 100644
> --- a/gas/config/tc-tic4x.c
> +++ b/gas/config/tc-tic4x.c
> @@ -2547,7 +2547,7 @@ tic4x_cleanup (void)
>     of chars emitted is stored in *sizeP.  An error message is
>     returned, or NULL on OK.  */
>  
> -char *
> +const char *
>  md_atof (int type, char *litP, int *sizeP)
>  {
>    int prec;
> diff --git a/gas/config/tc-tic54x.c b/gas/config/tc-tic54x.c
> index 611b537..8c33df4 100644
> --- a/gas/config/tc-tic54x.c
> +++ b/gas/config/tc-tic54x.c
> @@ -5062,7 +5062,7 @@ tic54x_parse_name (char *name ATTRIBUTE_UNUSED,
>    return 0;
>  }
>  
> -char *
> +const char *
>  md_atof (int type, char *literalP, int *sizeP)
>  {
>    /* Target data is little-endian, but floats are stored
> diff --git a/gas/config/tc-tic6x.c b/gas/config/tc-tic6x.c
> index 84fd368..2135dbf 100644
> --- a/gas/config/tc-tic6x.c
> +++ b/gas/config/tc-tic6x.c
> @@ -4078,7 +4078,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
>  
>  /* Convert a floating-point number to target (IEEE) format.  */
>  
> -char *
> +const char *
>  md_atof (int type, char *litP, int *sizeP)
>  {
>    return ieee_md_atof (type, litP, sizeP, target_big_endian);
> diff --git a/gas/config/tc-tilegx.c b/gas/config/tc-tilegx.c
> index 4cebfcf..bd42939 100644
> --- a/gas/config/tc-tilegx.c
> +++ b/gas/config/tc-tilegx.c
> @@ -1330,7 +1330,7 @@ md_number_to_chars (char * buf, valueT val, int n)
>     LITTLENUMS emitted is stored in *SIZEP.  An error message is
>     returned, or NULL on OK.  */
>  
> -char *
> +const char *
>  md_atof (int type, char *litP, int *sizeP)
>  {
>    int prec;
> diff --git a/gas/config/tc-tilepro.c b/gas/config/tc-tilepro.c
> index 1f5890d..a11b05f 100644
> --- a/gas/config/tc-tilepro.c
> +++ b/gas/config/tc-tilepro.c
> @@ -1205,7 +1205,7 @@ const pseudo_typeS md_pseudo_table[] =
>     LITTLENUMS emitted is stored in *SIZEP.  An error message is
>     returned, or NULL on OK.  */
>  
> -char *
> +const char *
>  md_atof (int type, char *litP, int *sizeP)
>  {
>    int prec;
> diff --git a/gas/config/tc-v850.c b/gas/config/tc-v850.c
> index bd762fb..5b425a9 100644
> --- a/gas/config/tc-v850.c
> +++ b/gas/config/tc-v850.c
> @@ -1372,7 +1372,7 @@ skip_white_space (void)
>     and so on upwards.  System registers are considered to be very
>     high numbers.  */
>  
> -static char *
> +static const char *
>  parse_register_list (unsigned long *insn,
>  		     const struct v850_operand *operand)
>  {
> @@ -1670,7 +1670,7 @@ md_undefined_symbol (char *name ATTRIBUTE_UNUSED)
>    return 0;
>  }
>  
> -char *
> +const char *
>  md_atof (int type, char *litp, int *sizep)
>  {
>    return ieee_md_atof (type, litp, sizep, FALSE);
> diff --git a/gas/config/tc-vax.c b/gas/config/tc-vax.c
> index 89fc6fc..538a994 100644
> --- a/gas/config/tc-vax.c
> +++ b/gas/config/tc-vax.c
> @@ -3403,7 +3403,7 @@ vax_cons_fix_new (fragS *frag, int where, unsigned int nbytes, expressionS *exp,
>    fix_new_exp (frag, where, (int) nbytes, exp, 0, r);
>  }
>  
> -char *
> +const char *
>  md_atof (int type, char * litP, int * sizeP)
>  {
>    return vax_md_atof (type, litP, sizeP);
> diff --git a/gas/config/tc-visium.c b/gas/config/tc-visium.c
> index 4ab5fca..c618524 100644
> --- a/gas/config/tc-visium.c
> +++ b/gas/config/tc-visium.c
> @@ -826,7 +826,7 @@ md_begin (void)
>  /* Equal to MAX_PRECISION in atof-ieee.c.  */
>  #define MAX_LITTLENUMS 6
>  
> -char *
> +const char *
>  md_atof (int type, char *litP, int *sizeP)
>  {
>    int i, prec;
> diff --git a/gas/config/tc-xc16x.c b/gas/config/tc-xc16x.c
> index 5e34e09..1fb964b 100644
> --- a/gas/config/tc-xc16x.c
> +++ b/gas/config/tc-xc16x.c
> @@ -225,7 +225,7 @@ md_parse_option (int c ATTRIBUTE_UNUSED,
>    return 0;
>  }
>  
> -char *
> +const char *
>  md_atof (int type, char *litP, int *sizeP)
>  {
>    return ieee_md_atof (type, litP, sizeP, FALSE);
> diff --git a/gas/config/tc-xgate.c b/gas/config/tc-xgate.c
> index 5b94158..1d68edc 100644
> --- a/gas/config/tc-xgate.c
> +++ b/gas/config/tc-xgate.c
> @@ -193,7 +193,7 @@ struct option md_longopts[] =
>  
>  size_t md_longopts_size = sizeof(md_longopts);
>  
> -char *
> +const char *
>  md_atof (int type, char *litP, int *sizeP)
>  {
>    return ieee_md_atof (type, litP, sizeP, TRUE);
> diff --git a/gas/config/tc-xstormy16.c b/gas/config/tc-xstormy16.c
> index 7ad3ea8..887160d 100644
> --- a/gas/config/tc-xstormy16.c
> +++ b/gas/config/tc-xstormy16.c
> @@ -596,7 +596,7 @@ md_number_to_chars (char * buf, valueT val, int n)
>    number_to_chars_littleendian (buf, val, n);
>  }
>  
> -char *
> +const char *
>  md_atof (int type, char * litP, int * sizeP)
>  {
>    return ieee_md_atof (type, litP, sizeP, FALSE);
> diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c
> index fe16659..c006418 100644
> --- a/gas/config/tc-xtensa.c
> +++ b/gas/config/tc-xtensa.c
> @@ -6073,7 +6073,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg)
>  }
>  
>  
> -char *
> +const char *
>  md_atof (int type, char *litP, int *sizeP)
>  {
>    return ieee_md_atof (type, litP, sizeP, target_big_endian);
> diff --git a/gas/config/tc-z80.c b/gas/config/tc-z80.c
> index 2e1dca9..7b1e72a 100644
> --- a/gas/config/tc-z80.c
> +++ b/gas/config/tc-z80.c
> @@ -384,7 +384,7 @@ md_undefined_symbol (char *name ATTRIBUTE_UNUSED)
>    return NULL;
>  }
>  
> -char *
> +const char *
>  md_atof (int type ATTRIBUTE_UNUSED, char *litP ATTRIBUTE_UNUSED,
>  	 int *sizeP ATTRIBUTE_UNUSED)
>  {
> diff --git a/gas/config/tc-z8k.c b/gas/config/tc-z8k.c
> index 64fca74..6a0d596 100644
> --- a/gas/config/tc-z8k.c
> +++ b/gas/config/tc-z8k.c
> @@ -1285,7 +1285,7 @@ md_undefined_symbol (char *name ATTRIBUTE_UNUSED)
>  
>  /* Various routines to kill one day.  */
>  
> -char *
> +const char *
>  md_atof (int type, char *litP, int *sizeP)
>  {
>    return ieee_md_atof (type, litP, sizeP, TRUE);
> diff --git a/gas/messages.c b/gas/messages.c
> index dc016bf..ad40ca8 100644
> --- a/gas/messages.c
> +++ b/gas/messages.c
> @@ -342,13 +342,13 @@ sprint_value (char *buf, valueT val)
>  #define HEX_MIN_THRESHOLD	-(HEX_MAX_THRESHOLD)
>  
>  static void
> -as_internal_value_out_of_range (const char *  prefix,
> -				offsetT       val,
> -				offsetT       min,
> -				offsetT       max,
> -				const char *        file,
> -				unsigned      line,
> -				int           bad)
> +as_internal_value_out_of_range (const char *prefix,
> +				offsetT val,
> +				offsetT min,
> +				offsetT max,
> +				const char *file,
> +				unsigned line,
> +				int bad)
>  {
>    const char * err;
>  
> @@ -414,22 +414,22 @@ as_internal_value_out_of_range (const char *  prefix,
>  }
>  
>  void
> -as_warn_value_out_of_range (char *   prefix,
> -			   offsetT  value,
> -			   offsetT  min,
> -			   offsetT  max,
> -			   const char *   file,
> +as_warn_value_out_of_range (const char *prefix,
> +			   offsetT value,
> +			   offsetT min,
> +			   offsetT max,
> +			   const char *file,
>  			   unsigned line)
>  {
>    as_internal_value_out_of_range (prefix, value, min, max, file, line, 0);
>  }
>  
>  void
> -as_bad_value_out_of_range (char *   prefix,
> -			   offsetT  value,
> -			   offsetT  min,
> -			   offsetT  max,
> -			   const char *   file,
> +as_bad_value_out_of_range (const char *prefix,
> +			   offsetT value,
> +			   offsetT min,
> +			   offsetT max,
> +			   const char *file,
>  			   unsigned line)
>  {
>    as_internal_value_out_of_range (prefix, value, min, max, file, line, 1);
> diff --git a/gas/read.c b/gas/read.c
> index 45023ca..35d44c1 100644
> --- a/gas/read.c
> +++ b/gas/read.c
> @@ -2136,7 +2136,7 @@ s_errwarn (int err)
>       self-contained message, one that can be passed like the
>       demand_copy_C_string return value, and with no assumption on the
>       location of the name of the directive within the message.  */
> -  char *msg
> +  const char *msg
>      = (err ? _(".error directive invoked in source file")
>         : _(".warning directive invoked in source file"));
>  
> @@ -3541,7 +3541,7 @@ s_float_space (int float_type)
>      }
>    else
>      {
> -      char *err;
> +      const char *err;
>  
>        err = md_atof (float_type, temp, &flen);
>        know (flen <= MAXIMUM_NUMBER_OF_CHARS_FOR_FLOAT);
> @@ -4920,7 +4920,7 @@ float_cons (/* Clobbers input_line-pointer, checks end-of-line.  */
>  {
>    char *p;
>    int length;			/* Number of chars in an object.  */
> -  char *err;		/* Error from scanning floating literal.  */
> +  const char *err;		/* Error from scanning floating literal.  */
>    char temp[MAXIMUM_NUMBER_OF_CHARS_FOR_FLOAT];
>  
>    if (is_it_end_of_statement ())
> diff --git a/gas/tc.h b/gas/tc.h
> index 3683466..51ff499 100644
> --- a/gas/tc.h
> +++ b/gas/tc.h
> @@ -24,7 +24,7 @@
>  
>  extern const pseudo_typeS md_pseudo_table[];
>  
> -char * md_atof (int, char *, int *);
> +const char * md_atof (int, char *, int *);
>  int    md_parse_option (int, const char *);
>  void   md_show_usage (FILE *);
>  void   md_assemble (char *);
> 
> -- 
> Alan Modra
> Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 0/7] enable -Wwrite-strings for gas
  2016-03-30  1:08 [PATCH 0/7] enable -Wwrite-strings for gas tbsaunde+binutils
                   ` (7 preceding siblings ...)
  2016-03-31 10:34 ` [PATCH 0/7] enable -Wwrite-strings for gas Alan Modra
@ 2016-05-01 16:44 ` Andrew Pinski
  2016-05-02 18:25   ` Trevor Saunders
  8 siblings, 1 reply; 17+ messages in thread
From: Andrew Pinski @ 2016-05-01 16:44 UTC (permalink / raw)
  To: tbsaunde+binutils; +Cc: binutils

On Tue, Mar 29, 2016 at 6:12 PM,  <tbsaunde+binutils@tbsaunde.org> wrote:
> From: Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
>
> Hi,
>
> At this point I think we've fixed basically all the -Wwrite-strings issues in
> gas that can be fixed reasonably without just adding casts.  So this series
> adds a handful of casts in several patches that try to explain why those casts
> are necessary, and then enables the warning for gas.
>
> I built one target per tc-*.c and regtested x86_64-linux-gnu, ok?


This patch set broke cross Canadian cross as the build compiler does
not have to be the same as the target compiler version on what options
are supported.
I use gcc 4.4.5 as my build compiler but the target compiler is GCC 7.

Thanks,
Andrew

>
> Trev
>
>
> Trevor Saunders (7):
>   cast literal to char * when assigning to input_line_ptr
>   work around get_symbol_name () in sparc and ia64
>   cast to char * when assigning to optarg
>   cast the arg to md_assemble () to char *
>   tc-i960.c: add some casts when assigning literals to args[i]
>   make xtensa_section_rename () take const char *
>   enable -Wwrite-strings for gas
>
>  bfd/configure          | 20 ++++++++++++++++++--
>  bfd/warning.m4         |  4 ++++
>  binutils/configure     | 20 ++++++++++++++++++--
>  gas/Makefile.am        |  2 +-
>  gas/Makefile.in        |  2 +-
>  gas/as.c               |  2 +-
>  gas/config/tc-i960.c   | 26 +++++++++++++-------------
>  gas/config/tc-ia64.c   |  6 ++++--
>  gas/config/tc-m32c.c   |  8 ++++----
>  gas/config/tc-m32r.c   |  2 +-
>  gas/config/tc-msp430.c |  2 +-
>  gas/config/tc-nds32.c  | 10 +++++-----
>  gas/config/tc-sparc.c  |  2 +-
>  gas/config/tc-xtensa.c |  6 +++---
>  gas/config/tc-xtensa.h |  2 +-
>  gas/config/tc-z80.c    |  2 +-
>  gas/configure          | 20 ++++++++++++++++++--
>  gas/stabs.c            |  2 +-
>  gold/configure         | 16 ++++++++++++++++
>  gprof/configure        | 20 ++++++++++++++++++--
>  ld/configure           | 20 ++++++++++++++++++--
>  opcodes/configure      | 20 ++++++++++++++++++--
>  22 files changed, 166 insertions(+), 48 deletions(-)
>
> --
> 2.1.4
>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 0/7] enable -Wwrite-strings for gas
  2016-05-01 16:44 ` Andrew Pinski
@ 2016-05-02 18:25   ` Trevor Saunders
  2016-05-02 19:38     ` Andrew Pinski
  0 siblings, 1 reply; 17+ messages in thread
From: Trevor Saunders @ 2016-05-02 18:25 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: tbsaunde+binutils, binutils

On Sun, May 01, 2016 at 09:44:06AM -0700, Andrew Pinski wrote:
> On Tue, Mar 29, 2016 at 6:12 PM,  <tbsaunde+binutils@tbsaunde.org> wrote:
> > From: Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
> >
> > Hi,
> >
> > At this point I think we've fixed basically all the -Wwrite-strings issues in
> > gas that can be fixed reasonably without just adding casts.  So this series
> > adds a handful of casts in several patches that try to explain why those casts
> > are necessary, and then enables the warning for gas.
> >
> > I built one target per tc-*.c and regtested x86_64-linux-gnu, ok?
> 
> 
> This patch set broke cross Canadian cross as the build compiler does
> not have to be the same as the target compiler version on what options
> are supported.
> I use gcc 4.4.5 as my build compiler but the target compiler is GCC 7.

I'm not sure what is going on, and would have to build a compiler that
old, but it doesn't seem to make much sense.  According to
https://gcc.gnu.org/onlinedocs/gcc-4.0.4/gcc/Warning-Options.html#Warning-Options
-Wwrite-strings was supported in gcc 4.0, so presumably your gcc 4.4.5
should accept it.

Trev

> 
> Thanks,
> Andrew
> 
> >
> > Trev
> >
> >
> > Trevor Saunders (7):
> >   cast literal to char * when assigning to input_line_ptr
> >   work around get_symbol_name () in sparc and ia64
> >   cast to char * when assigning to optarg
> >   cast the arg to md_assemble () to char *
> >   tc-i960.c: add some casts when assigning literals to args[i]
> >   make xtensa_section_rename () take const char *
> >   enable -Wwrite-strings for gas
> >
> >  bfd/configure          | 20 ++++++++++++++++++--
> >  bfd/warning.m4         |  4 ++++
> >  binutils/configure     | 20 ++++++++++++++++++--
> >  gas/Makefile.am        |  2 +-
> >  gas/Makefile.in        |  2 +-
> >  gas/as.c               |  2 +-
> >  gas/config/tc-i960.c   | 26 +++++++++++++-------------
> >  gas/config/tc-ia64.c   |  6 ++++--
> >  gas/config/tc-m32c.c   |  8 ++++----
> >  gas/config/tc-m32r.c   |  2 +-
> >  gas/config/tc-msp430.c |  2 +-
> >  gas/config/tc-nds32.c  | 10 +++++-----
> >  gas/config/tc-sparc.c  |  2 +-
> >  gas/config/tc-xtensa.c |  6 +++---
> >  gas/config/tc-xtensa.h |  2 +-
> >  gas/config/tc-z80.c    |  2 +-
> >  gas/configure          | 20 ++++++++++++++++++--
> >  gas/stabs.c            |  2 +-
> >  gold/configure         | 16 ++++++++++++++++
> >  gprof/configure        | 20 ++++++++++++++++++--
> >  ld/configure           | 20 ++++++++++++++++++--
> >  opcodes/configure      | 20 ++++++++++++++++++--
> >  22 files changed, 166 insertions(+), 48 deletions(-)
> >
> > --
> > 2.1.4
> >

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 0/7] enable -Wwrite-strings for gas
  2016-05-02 18:25   ` Trevor Saunders
@ 2016-05-02 19:38     ` Andrew Pinski
  2016-05-03  8:12       ` Nick Clifton
  0 siblings, 1 reply; 17+ messages in thread
From: Andrew Pinski @ 2016-05-02 19:38 UTC (permalink / raw)
  To: Trevor Saunders; +Cc: tbsaunde+binutils, binutils

On Mon, May 2, 2016 at 11:30 AM, Trevor Saunders <tbsaunde@tbsaunde.org> wrote:
> On Sun, May 01, 2016 at 09:44:06AM -0700, Andrew Pinski wrote:
>> On Tue, Mar 29, 2016 at 6:12 PM,  <tbsaunde+binutils@tbsaunde.org> wrote:
>> > From: Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
>> >
>> > Hi,
>> >
>> > At this point I think we've fixed basically all the -Wwrite-strings issues in
>> > gas that can be fixed reasonably without just adding casts.  So this series
>> > adds a handful of casts in several patches that try to explain why those casts
>> > are necessary, and then enables the warning for gas.
>> >
>> > I built one target per tc-*.c and regtested x86_64-linux-gnu, ok?
>>
>>
>> This patch set broke cross Canadian cross as the build compiler does
>> not have to be the same as the target compiler version on what options
>> are supported.
>> I use gcc 4.4.5 as my build compiler but the target compiler is GCC 7.
>
> I'm not sure what is going on, and would have to build a compiler that
> old, but it doesn't seem to make much sense.  According to
> https://gcc.gnu.org/onlinedocs/gcc-4.0.4/gcc/Warning-Options.html#Warning-Options
> -Wwrite-strings was supported in gcc 4.0, so presumably your gcc 4.4.5
> should accept it.


Sorry it was not this patch but rather the one which enable
-Wstack-usage one.  For some reason my mail client pointed to this
patch that added that.

Thanks,
Andrew


>
> Trev
>
>>
>> Thanks,
>> Andrew
>>
>> >
>> > Trev
>> >
>> >
>> > Trevor Saunders (7):
>> >   cast literal to char * when assigning to input_line_ptr
>> >   work around get_symbol_name () in sparc and ia64
>> >   cast to char * when assigning to optarg
>> >   cast the arg to md_assemble () to char *
>> >   tc-i960.c: add some casts when assigning literals to args[i]
>> >   make xtensa_section_rename () take const char *
>> >   enable -Wwrite-strings for gas
>> >
>> >  bfd/configure          | 20 ++++++++++++++++++--
>> >  bfd/warning.m4         |  4 ++++
>> >  binutils/configure     | 20 ++++++++++++++++++--
>> >  gas/Makefile.am        |  2 +-
>> >  gas/Makefile.in        |  2 +-
>> >  gas/as.c               |  2 +-
>> >  gas/config/tc-i960.c   | 26 +++++++++++++-------------
>> >  gas/config/tc-ia64.c   |  6 ++++--
>> >  gas/config/tc-m32c.c   |  8 ++++----
>> >  gas/config/tc-m32r.c   |  2 +-
>> >  gas/config/tc-msp430.c |  2 +-
>> >  gas/config/tc-nds32.c  | 10 +++++-----
>> >  gas/config/tc-sparc.c  |  2 +-
>> >  gas/config/tc-xtensa.c |  6 +++---
>> >  gas/config/tc-xtensa.h |  2 +-
>> >  gas/config/tc-z80.c    |  2 +-
>> >  gas/configure          | 20 ++++++++++++++++++--
>> >  gas/stabs.c            |  2 +-
>> >  gold/configure         | 16 ++++++++++++++++
>> >  gprof/configure        | 20 ++++++++++++++++++--
>> >  ld/configure           | 20 ++++++++++++++++++--
>> >  opcodes/configure      | 20 ++++++++++++++++++--
>> >  22 files changed, 166 insertions(+), 48 deletions(-)
>> >
>> > --
>> > 2.1.4
>> >

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 0/7] enable -Wwrite-strings for gas
  2016-05-02 19:38     ` Andrew Pinski
@ 2016-05-03  8:12       ` Nick Clifton
  0 siblings, 0 replies; 17+ messages in thread
From: Nick Clifton @ 2016-05-03  8:12 UTC (permalink / raw)
  To: Andrew Pinski, Trevor Saunders; +Cc: tbsaunde+binutils, binutils

Hi Andrew,

> Sorry it was not this patch but rather the one which enable
> -Wstack-usage one.

Is this still a problem ? 

The -Wstack-usage patch now only enables the option with a gcc 
version 5 or higher, so I believe that it should work, even in 
a Canadian cross build.

Cheers
  Nick


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2016-05-03  8:12 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-30  1:08 [PATCH 0/7] enable -Wwrite-strings for gas tbsaunde+binutils
2016-03-30  1:08 ` [PATCH 1/7] cast literal to char * when assigning to input_line_ptr tbsaunde+binutils
2016-03-30  1:08 ` [PATCH 2/7] work around get_symbol_name () in sparc and ia64 tbsaunde+binutils
2016-03-30  1:08 ` [PATCH 3/7] cast to char * when assigning to optarg tbsaunde+binutils
2016-03-30  1:08 ` [PATCH 5/7] tc-i960.c: add some casts when assigning literals to args[i] tbsaunde+binutils
2016-03-30  1:08 ` [PATCH 7/7] enable -Wwrite-strings for gas tbsaunde+binutils
2016-04-01 11:22   ` Jiong Wang
2016-04-01 12:17     ` Trevor Saunders
2016-04-01 12:40     ` Alan Modra
2016-04-01 13:10       ` Trevor Saunders
2016-03-30  1:14 ` [PATCH 6/7] make xtensa_section_rename () take const char * tbsaunde+binutils
2016-03-30  1:14 ` [PATCH 4/7] cast the arg to md_assemble () to " tbsaunde+binutils
2016-03-31 10:34 ` [PATCH 0/7] enable -Wwrite-strings for gas Alan Modra
2016-05-01 16:44 ` Andrew Pinski
2016-05-02 18:25   ` Trevor Saunders
2016-05-02 19:38     ` Andrew Pinski
2016-05-03  8:12       ` Nick Clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).