On Thu, Mar 08, 2018 at 03:16:30PM +0100, Paul Menzel wrote:
> Dear SeaBIOS folks,
> 
> Building SeaBIOS with GCC 8, the warnings below are shown.
[...]
> In file included from src/fw/shadow.c:17:
> src/fw/shadow.c: In function 'qemu_reboot':
> src/string.h:23:16: warning: '__builtin_memcpy' offset -1048576 is out of the 
> bounds [0, 1] of object 'code32flat_start' with type 'char' [-Warray-bounds]
>  #define memcpy __builtin_memcpy
> src/fw/shadow.c:190:9: note: in expansion of macro 'memcpy'
>          memcpy(cstart, cstart + BIOS_SRC_OFFSET, hrp - cstart);
>          ^~~~~~

Well, technically the above code isn't valid C.  It's always worked in
practice though.  The code needs to perform some memory copies based
on physical addresses in memory - and we use the ELF symbol table to
get at those memory addresses.

I'm surprsied that gcc still compains after the addresses have been
cast to an integer.  I'm not sure what format would make gcc happy.

-Kevin

_______________________________________________
SeaBIOS mailing list
SeaBIOS@seabios.org
https://mail.coreboot.org/mailman/listinfo/seabios

Reply via email to