arch/ppc/qemu/init.c: work around GCC bug for ppc64_patch_handlers()
Dereferencing a constant address pointer when -Warray-bounds is enabled in gcc
generates an erroneous warning:
In function 'ppc64_patch_handlers',
inlined from 'cpu_970_init' at /root/arch/ppc/qemu/init.c:433:5:
/root/arch/ppc/qemu/init.c:400:10: error: array subscript 0 is outside array bounds of 'uint32_t[0]' {aka 'unsigned int[]'} [-Werror=array-bounds]
400 | *dsi = 0x48002002;
| ~~~~~^~~~~~~~~~~~
/root/arch/ppc/qemu/init.c:403:10: error: array subscript 0 is outside array bounds of 'uint32_t[0]' {aka 'unsigned int[]'} [-Werror=array-bounds]
403 | *isi = 0x48002202;
| ~~~~~^~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [rules.mak:323: target/arch/ppc/qemu/init.o] Error 1
make[1]: Leaving directory '/root/obj-ppc'
This is a known bug in gcc 12 as described at
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523. Work around the bug for
now by disabling the warning for ppc64_patch_handlers().
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
1 file changed