[SeaBIOS] New build warnings from GCC 8

Kevin O'Connor kevin at koconnor.net
Mon Mar 12 23:16:52 CET 2018

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.


More information about the SeaBIOS mailing list