[PATCH 13/23] sim/erc32: Fix a few compiler warnings

Jiri Gaisler jiri@gaisler.se
Wed Feb 18 16:21:00 GMT 2015



On 02/17/2015 12:07 PM, Mike Frysinger wrote:
> 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.

I am passing cmd to strok() at one place, so const char cannot be used.

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

I will keep this on my soon-todo list. Please bare with it this time ...

Jiri.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 884 bytes
Desc: OpenPGP digital signature
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20150218/6878c168/attachment.sig>


More information about the Gdb-patches mailing list