Skip to content

Fix GCC 12 build error

Michael Chang grub-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 1 replyIn review
  2. v13 patches 6 repliesSuperseded

Changes in v2 from the cover letter

Fix -Werror=array-bounds array subscript 0 is outside array bounds
1. Replace null with NULL in commit message
2. Add explain to do variable shuffling in commit message
3. Change macro grub_absolute_pointer definition to include/grub/types.h
4. Use grub_addr_t as pointer type in grub_absolute_pointer
5. Use asm keyword instead of __asm__
6. Mention RELOC_HIDE() macro in the comment of grub_absolute_pointer

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3mkimage: Fix dangling pointer may be used errorutil/mkimage.c+21 -00 replies
2/3Fix -Werror=array-bounds array subscript 0 is outside array boundsgrub-core/bus/cs5536.c grub-core/commands/acpi.c grub-core/commands/efi/loadbios.c +15 more+86 -551 reply
3/3reed_solomon: Fix array subscript 0 is outside array boundsgrub-core/lib/reed_solomon.c+9 -00 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchDaniel Kiper
1/3R-b
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/3] Fix GCC 12 build error

The tested gcc version is:

abuild@mazu:~> gcc --version
gcc (SUSE Linux) 12.0.1 20220307 (experimental) [revision 40c1d4a07e5798c01e4364336c9617550744861d] Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Although it may not catch all build errors as there are quite many combinations of cpu architecture and platform which grub supports. The work is as far as I can get right now and I'd like to have them reviewed before anyone running into similar problems.

v2:
Fix -Werror=array-bounds array subscript 0 is outside array bounds
1. Replace null with NULL in commit message
2. Add explain to do variable shuffling in commit message
3. Change macro grub_absolute_pointer definition to include/grub/types.h
4. Use grub_addr_t as pointer type in grub_absolute_pointer
5. Use asm keyword instead of __asm__
6. Mention RELOC_HIDE() macro in the comment of grub_absolute_pointer

Thanks,
Michael

Michael Chang (3):
mkimage: Fix dangling pointer may be used error
Fix -Werror=array-bounds array subscript 0 is outside array bounds
reed_solomon: Fix array subscript 0 is outside array bounds

 grub-core/bus/cs5536.c                |  4 ++--
 grub-core/commands/acpi.c             |  4 ++--
 grub-core/commands/efi/loadbios.c     |  9 +++++----
 grub-core/commands/i386/pc/drivemap.c |  8 +++++---
 grub-core/commands/i386/pc/sendkey.c  | 12 ++++++------
 grub-core/disk/i386/pc/biosdisk.c     |  4 ++--
 grub-core/fs/cbfs.c                   |  2 +-
 grub-core/kern/i386/pc/acpi.c         |  4 ++--
 grub-core/kern/i386/pc/mmap.c         |  2 +-
 grub-core/lib/reed_solomon.c          |  9 +++++++++
 grub-core/loader/i386/multiboot_mbi.c |  2 +-
 grub-core/loader/multiboot_mbi2.c     |  4 ++--
 grub-core/mmap/i386/pc/mmap.c         | 26 +++++++++++++-------------
 grub-core/net/drivers/i386/pc/pxe.c   | 12 ++++++------
 grub-core/term/i386/pc/console.c      |  5 ++---
 grub-core/term/i386/pc/vga_text.c     |  6 +++---
 grub-core/term/ns8250.c               |  7 ++++++-
 grub-core/video/i386/pc/vbe.c         |  6 +++---
 include/grub/types.h                  | 24 ++++++++++++++++++++++++
 util/mkimage.c                        | 21 +++++++++++++++++++++
 20 files changed, 116 insertions(+), 55 deletions(-)
Signature · 1 line
2.34.1