Re: [PATCH 5/5] sim/iq2000: silence pointer-sign warnings

Andrew Burgess via Gdb-patches
2022-10-24T15:45:55Z

Mike Frysinger <vapier@gentoo.org> writes:

> On 12 Oct 2022 13:38, Andrew Burgess via Gdb-patches wrote:
>> When building the iq2000 simulator I see a few warnings like this:
>>
>> /tmp/build/sim/../../src/sim/iq2000/iq2000.c: In function ‘fetch_str’:
>> /tmp/build/sim/../../src/sim/iq2000/iq2000.c:50:54: error: pointer targets in passing argument 3 of ‘sim_read’ differ in signedness [-Werror=pointer-sign]
>> 50 | sim_read (CPU_STATE (current_cpu), CPU2DATA(addr), buf, nr);
>> | ^~~
>> | |
>> | char *
>>
>> I've silenced these warnings by casting buf to 'unsigned char *'.
>> With this change I now see no warnings when compiling iq2000.c, so
>> I've removed the line from Makefile.in that disables -Werror.
>
> i left this warning in place so someone would fix it properly rather than
> just cast it away

Sorry for not understanding that. If you'd like to expand on "properly"
I'll take a pass at fixing it.

Thanks,
Andrew