[PATCH] sim/erc32: fix signedness compatiblity and redefinition warnings

Mike Frysinger vapier@gentoo.org
Fri Oct 29 05:31:18 GMT 2021


On 28 Oct 2021 07:55, Orgad Shaneh via Gdb-patches wrote:

most of the patch looks fine enough

> @@ -1587,7 +1586,7 @@ memory_read(int32 asi, uint32 addr, uint32 *data, int32 sz, int32 *ws)
>  	*ws = mem_ramr_ws;
>  	return 0;
>      } else if ((addr >= MEC_START) && (addr < MEC_END)) {
> -	mexc = mec_read(addr, asi, data);
> +	mexc = mec_read(addr, asi, (uint32 *)data);

data is a void pointer, so you shouldn't need this cast in C

> @@ -1607,7 +1606,7 @@ memory_read(int32 asi, uint32 addr, uint32 *data, int32 sz, int32 *ws)
>  	} else if ((addr >= 0x10000000) && 
>  		   (addr < (0x10000000 + (512 << (mec_iocr & 0x0f)))) &&
>  		   (mec_iocr & 0x10))  {
> -	    *data = erareg;
> +	    *(uint32 *)data = erareg;

probably would be better to use memcpy on it
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/gdb-patches/attachments/20211029/79824f37/attachment.sig>


More information about the Gdb-patches mailing list