diff options
Diffstat (limited to 'debian/patches/openbios-array-bounds-gcc12.patch')
-rw-r--r-- | debian/patches/openbios-array-bounds-gcc12.patch | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/debian/patches/openbios-array-bounds-gcc12.patch b/debian/patches/openbios-array-bounds-gcc12.patch new file mode 100644 index 00000000..a96048b1 --- /dev/null +++ b/debian/patches/openbios-array-bounds-gcc12.patch @@ -0,0 +1,25 @@ +Subject: openbios: do not error-out array-bounds warning +From: Michael Tokarev <mjt@tls.msk.ru> +Date: Fri, 02 Sep 2022 18:35:30 +0300 + +gcc-12.2 produces an apparently wrong warning for this file: + +roms/openbios/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; + | =====^=========== + +Turn this particular -Werror back into warning. Gcc is apparently wrong here. + +index e40385a70b..2e214aa079 100644 +--- a/roms/openbios/arch/ppc/qemu/init.c ++++ b/roms/openbios/arch/ppc/qemu/init.c +@@ -397,4 +397,7 @@ ppc64_patch_handlers(void) + uint32_t *isi = (uint32_t *)0x400UL; + ++#pragma GCC diagnostic warning "-Warray-bounds" ++/* gcc-12 misreports array-bounds error in the following two assignments: */ ++ + // Patch the first DSI handler instruction to: ba 0x2000 + *dsi = 0x48002002; |