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 13/23] sim/erc32: Fix a few compiler warnings


On 17 Feb 2015 08:44, Jiri Gaisler wrote:
> 	Minor edits to remove compiler warnings.

if you're really interested in doing this, you could add SIM_AC_OPTION_WARNINGS 
to the erc32/configure.ac script ...

> --- a/sim/erc32/interf.c
> +++ b/sim/erc32/interf.c
> @@ -509,7 +509,7 @@ sim_do_command(sd, cmd)
>       SIM_DESC sd;
>       const char *cmd;
>  {
> -    exec_cmd(&sregs, cmd);
> +    exec_cmd(&sregs, (char *) cmd);
>  }

shouldn't exec_cmd be changed to take a const char * instead ?  looks to me like 
it treats it as constant ... it does a strdup(cmd) and only operates on the 
result.

looking further, seems like it this func really should use buildargv/freeargv 
rather than tokenize things itself ?
-mike

Attachment: signature.asc
Description: Digital signature


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