This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] cli-setshow.c: Constify variable
- From: Simon Marchi <simark at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 25 Oct 2015 02:30:23 -0000
- Subject: [binutils-gdb] cli-setshow.c: Constify variable
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=1650ca11248ca377a6c8b6f7e21ec2aa8e7b3fd5
commit 1650ca11248ca377a6c8b6f7e21ec2aa8e7b3fd5
Author: Simon Marchi <simon.marchi@polymtl.ca>
Date: Sat Oct 24 22:28:56 2015 -0400
cli-setshow.c: Constify variable
Fixes:
/home/simark/src/binutils-gdb/gdb/cli/cli-setshow.c:390:13: error: invalid conversion from â??const char*â?? to â??char*â?? [-fpermissive]
p = strchr (arg, ' ');
^
gdb/ChangeLog:
* cli/cli-setshow.c (do_set_command): Constify p.
Diff:
---
gdb/ChangeLog | 4 ++++
gdb/cli/cli-setshow.c | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d658649..3017fd0 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
2015-10-24 Simon Marchi <simon.marchi@polymtl.ca>
+ * cli/cli-setshow.c (do_set_command): Constify p.
+
+2015-10-24 Simon Marchi <simon.marchi@polymtl.ca>
+
* nat/linux-ptrace.c (linux_ptrace_test_ret_to_nx): Replace
(void *) cast with (gdb_byte *).
diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c
index 1ffb80b..74d2d00 100644
--- a/gdb/cli/cli-setshow.c
+++ b/gdb/cli/cli-setshow.c
@@ -361,7 +361,7 @@ do_set_command (const char *arg, int from_tty, struct cmd_list_element *c)
int len;
int nmatches;
const char *match = NULL;
- char *p;
+ const char *p;
/* If no argument was supplied, print an informative error
message. */