diff options
author | Thomas Schwinge <thomas@codesourcery.com> | 2019-02-14 10:22:28 +0100 |
---|---|---|
committer | Thomas Schwinge <thomas@codesourcery.com> | 2019-02-14 17:14:33 +0100 |
commit | 924514e11c21ac5a5805e7a14824b6f3182b2198 (patch) | |
tree | faa2407b0571539acd2a513fed9089b802823a18 /gdb | |
parent | c29ee8d45ec2113821c006a18cfedb9023ef9ce1 (diff) | |
download | gdb-924514e11c21ac5a5805e7a14824b6f3182b2198.zip gdb-924514e11c21ac5a5805e7a14824b6f3182b2198.tar.gz gdb-924514e11c21ac5a5805e7a14824b6f3182b2198.tar.bz2 |
[gdb, hurd] Address "ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]" diagnostics
... that appeared with 9bf2a700667c53003ece783c05e8b355801105f2
"-Wwrite-strings: Remove -Wno-write-strings".
gdb/
* gnu-nat.c (gnu_write_inferior, parse_int_arg, _parse_bool_arg)
(check_empty): Use "const char *".
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 3 | ||||
-rw-r--r-- | gdb/gnu-nat.c | 9 |
2 files changed, 8 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 71c61bc..e427dda 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,8 @@ 2019-02-14 Thomas Schwinge <thomas@codesourcery.com> + * gnu-nat.c (gnu_write_inferior, parse_int_arg, _parse_bool_arg) + (check_empty): Use "const char *". + * gnu-nat.c (gnu_nat_target::detach): Instead of 'detach_inferior (pid)' call 'detach_inferior (find_inferior_pid (pid))'. diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c index 67cc95c..395b456 100644 --- a/gdb/gnu-nat.c +++ b/gdb/gnu-nat.c @@ -2361,7 +2361,7 @@ gnu_write_inferior (task_t task, CORE_ADDR addr, mach_msg_type_number_t copy_count; int deallocate = 0; - char *errstr = "Bug in gnu_write_inferior"; + const char *errstr = "Bug in gnu_write_inferior"; struct vm_region_list *region_element; struct vm_region_list *region_head = NULL; @@ -2778,7 +2778,7 @@ show_thread_default_cmd (const char *args, int from_tty) } static int -parse_int_arg (const char *args, char *cmd_prefix) +parse_int_arg (const char *args, const char *cmd_prefix) { if (args) { @@ -2793,7 +2793,8 @@ parse_int_arg (const char *args, char *cmd_prefix) } static int -_parse_bool_arg (const char *args, char *t_val, char *f_val, char *cmd_prefix) +_parse_bool_arg (const char *args, const char *t_val, const char *f_val, + const char *cmd_prefix) { if (!args || strcmp (args, t_val) == 0) return 1; @@ -2809,7 +2810,7 @@ _parse_bool_arg (const char *args, char *t_val, char *f_val, char *cmd_prefix) _parse_bool_arg (args, "on", "off", cmd_prefix) static void -check_empty (const char *args, char *cmd_prefix) +check_empty (const char *args, const char *cmd_prefix) { if (args) error (_("Garbage after \"%s\" command: `%s'"), cmd_prefix, args); |