tools/ifwitool.c:573:26: warning: array subscript [28, 51539607568] is outside array bounds of ‘struct bpdt[0]’ [-Warray-bounds

Heinrich Schuchardt xypron.glpk at gmx.de
Sat Jan 14 10:25:03 CET 2023


Hello Mikhail,

compiling sandbox_defconfig with gives me a lot of these warnings with
gcc 12.2 (as available in Ubuntu 23.04 Lunar). As you have been
contributing to tools/ifwitool.c lately you might want to have a look at it.

tools/ifwitool.c:1435:22: note: at offset [32, 51539607572] into object
‘s’ of size 8
  1435 |         struct bpdt *s = buffer_get(buf);
       |                      ^
In function ‘write_ble8’,
     inlined from ‘write_le8’ at tools/ifwitool.c:591:2,
     inlined from ‘write_le16’ at tools/ifwitool.c:616:2,
     inlined from ‘write_le32’ at tools/ifwitool.c:646:2,
     inlined from ‘write_at_le32’ at tools/ifwitool.c:655:2,
     inlined from ‘fix_member’ at tools/ifwitool.c:734:3,
     inlined from ‘bpdt_fixup_write_buffer’ at tools/ifwitool.c:1457:12,
     inlined from ‘bpdt_write’ at tools/ifwitool.c:1464:2:
tools/ifwitool.c:573:26: warning: array subscript [32, 51539607572] is
outside array bounds of ‘struct bpdt[0]’ [-Warray-bounds]
   573 |         *(uint8_t *)dest = val;
       |         ~~~~~~~~~~~~~~~~~^~~~~
tools/ifwitool.c: In function ‘bpdt_write’:
tools/ifwitool.c:1435:22: note: at offset [32, 51539607572] into object
‘s’ of size 8
  1435 |         struct bpdt *s = buffer_get(buf);
       |                      ^

Best regards

Heinrich


More information about the U-Boot mailing list