This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 15/18] -Wwrite-strings: execute_command calls with string literals


On 04/05/2017 08:13 AM, Metzger, Markus T wrote:

> The patch looks good to me.  But I'm wondering if we should instead change
> execute_command to take a const char *.

That's not that simple, because some commands do want to modify the
input string.

For example, cli/cli-cmds.c:list_command does:

  /* If this command is repeated with RET,
     turn it into the no-arg variant.  */

  if (from_tty)
    *arg = 0;


and also, it'd require a lot of cascading constification
inside many commands, because lots of command args processing
passes "&args" to some routine that expects a "char **".

Thanks,
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]