This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 38/67] Constify some linespec functions
>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
Pedro> In several places you followed a pattern like:
>> static void
>> -foo_command (char *args, int from_tty)
>> +foo_command (char *args_in, int from_tty)
Pedro> ... and then args_in wasn't used.
Hmm... normally I think it should be used.
Like in this patch (#38):
-info_scope_command (char *args, int from_tty)
+info_scope_command (char *args_in, int from_tty)
...
- char *save_args = args;
+ const char *save_args = args_in;
...
+ const char *args = args_in;
Pedro> I'd be nice to mention in the commit log the reason for this.
Pedro> I assume that it's because we don't have the corresponding
Pedro> constified add_cmd variant?
In this case I believe the reason is that info_scope_command could not
be constified yet, because add_info isn't constified; but on the other
hand it calls string_to_event_location, which is now constified, and it
didn't seem worthwhile to overload that.
I think all the cases *should* be things like this, but of course there
may be errors.
Tom