[binutils-gdb] Fix gdb/remote.c build failure

Szabolcs Nagy nsz@sourceware.org
Wed Aug 8 10:31:00 GMT 2018


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

commit ff36536c9273734af6f84832b583c10f44c5010e
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Wed Aug 8 11:14:20 2018 +0100

    Fix gdb/remote.c build failure
    
    Add const qualifier to fix
    
    /S/gdb/common/gdb_locale.h:35:27: error: deprecated conversion from string constant to 'char*' [-Werror=write-strings]
     # define _(String) (String)
                               ^
    /S/gdb/remote.c:12844:19: note: in expansion of macro '_'
       char *err_msg = _("Tracepoint packet too large for target.");
                       ^
    gdb/ChangeLog:
    
    	* remote.c (remote_target::download_tracepoint): Change char* to
    	const char*.

Diff:
---
 gdb/ChangeLog | 5 +++++
 gdb/remote.c  | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 6702b44..2f5d1ef 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2018-08-08  Szabolcs Nagy  <szabolcs.nagy@arm.com>
+
+	* remote.c (remote_target::download_tracepoint): Change char* to
+	const char*.
+
 2018-08-07  Simon Marchi  <simon.marchi@polymtl.ca>
 
 	* target.h (target_options_to_string): Return an std::string.
diff --git a/gdb/remote.c b/gdb/remote.c
index 33f6cd5..3b19da7 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -12841,7 +12841,7 @@ remote_target::download_tracepoint (struct bp_location *loc)
   struct tracepoint *t = (struct tracepoint *) b;
   struct remote_state *rs = get_remote_state ();
   int ret;
-  char *err_msg = _("Tracepoint packet too large for target.");
+  const char *err_msg = _("Tracepoint packet too large for target.");
   size_t size_left;
 
   /* We use a buffer other than rs->buf because we'll build strings



More information about the Gdb-cvs mailing list