From 857ef69b3f0cacdb9bb84f6ccbc7d62c5a28a65d Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Tue, 19 Jan 2021 11:46:40 +0100 Subject: [PATCH] software/bios/boot: Fix cast to pointer from integer of different size warnings On 64-bit: litex/soc/software/bios/boot.c: In function 'serialboot': litex/soc/software/bios/boot.c:216:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] writepointer = (char *) get_uint32(&frame.payload[0]); ^ When casting from a 32-bit integer to a pointer (32-bit or 64-bit, depending on the platform), an intermediate cast to "uintptr_t" should be used to avoid warnings like the above. Note that using a 32-bit integer is OK, even on 64-bit, as this is specified by the boot protocol. Signed-off-by: Geert Uytterhoeven --- litex/soc/software/bios/boot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litex/soc/software/bios/boot.c b/litex/soc/software/bios/boot.c index 7516c0dd6..67aaf1417 100644 --- a/litex/soc/software/bios/boot.c +++ b/litex/soc/software/bios/boot.c @@ -212,7 +212,7 @@ int serialboot(void) char *writepointer; failed = 0; - writepointer = (char *) get_uint32(&frame.payload[0]); + writepointer = (char *)(uintptr_t) get_uint32(&frame.payload[0]); for(i=4;i