[binutils-gdb] constify xcoffread.c

Yao Qi qiyao@sourceware.org
Fri Mar 20 17:43:00 GMT 2015


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e28566f7d022e672bc7032d4951112359ad66d77

commit e28566f7d022e672bc7032d4951112359ad66d77
Author: Pedro Alves <palves@redhat.com>
Date:   Mon Mar 9 11:58:20 2015 +0000

    constify xcoffread.c
    
    /home/pedro/gdb/mygit/src/gdb/xcoffread.c: In function ‘void scan_xcoff_symtab(objfile*)’:
    /home/pedro/gdb/mygit/src/gdb/xcoffread.c:2644:33: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
          p = strchr (namestring, ':');
                                     ^
    gdb:
    
    2015-03-20  Pedro Alves  <palves@redhat.com>
    
    	* xcoffread.c (scan_xcoff_symtab): Make "p" and "q" const.

Diff:
---
 gdb/ChangeLog   | 4 ++++
 gdb/xcoffread.c | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index b71739e..c1d19a8 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
 2015-03-20  Pedro Alves  <palves@redhat.com>
 
+	* xcoffread.c (scan_xcoff_symtab): Make "p" and "q" const.
+
+2015-03-20  Pedro Alves  <palves@redhat.com>
+
 	* remote-m32r-sdi.c (m32r_open): Make "port_str" const.
 
 2015-03-20  Pedro Alves  <palves@redhat.com>
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
index 3cb6eda..9571ac8 100644
--- a/gdb/xcoffread.c
+++ b/gdb/xcoffread.c
@@ -2636,7 +2636,7 @@ scan_xcoff_symtab (struct objfile *objfile)
 	case C_DECL:
 	case C_STSYM:
 	  {
-	    char *p;
+	    const char *p;
 
 	    swap_sym (&symbol, &main_aux[0], &namestring, &sraw_symbol,
 		      &ssymnum, objfile);
@@ -2763,7 +2763,7 @@ scan_xcoff_symtab (struct objfile *objfile)
 		       Accept either.  */
 		    while (*p && *p != ';' && *p != ',')
 		      {
-			char *q;
+			const char *q;
 
 			/* Check for and handle cretinous dbx symbol name
 			   continuation!  */



More information about the Gdb-cvs mailing list