osdep/windows/platform: Disable gcc9 -Waddress-of-packed-member
commit70406f432b89426e2b1ac380363697db02e84e72
authorDaniel Kiper <daniel.kiper@oracle.com>
Thu, 10 Mar 2022 15:10:17 +0000 (10 16:10 +0100)
committerDaniel Kiper <daniel.kiper@oracle.com>
Mon, 14 Mar 2022 22:05:00 +0000 (14 23:05 +0100)
tree0e5aa27a7d75e052d0cf0a4bc371d3b342cfcce4
parent0cfb9240ae2deeec1437bc1fc885a23842bbd132
osdep/windows/platform: Disable gcc9 -Waddress-of-packed-member

$ ./configure --target=x86_64-w64-mingw32 --with-platform=efi --host=x86_64-w64-mingw32
$ make

[...]

In file included from grub-core/osdep/platform.c:4:
grub-core/osdep/windows/platform.c: In function ‘grub_install_register_efi’:
grub-core/osdep/windows/platform.c:382:41: error: taking address of packed member of ‘struct grub_efi_file_path_device_path’ may result in an unaligned pointer value [-Werror=address-of-packed-member]
  382 |   path16_len = grub_utf8_to_utf16 (filep->path_name,
      |                                    ~~~~~^~~~~~~~~~~

Disable the -Wadress-of-packaed-member diagnostic for grub_utf8_to_utf16()
call which contains filep->path_name reference. It seems safe because the
structure is defined according to the UEFI spec and we hope authors did not
make any mistake... :-)

This fix is similar to the fix in the commit 8e8723a6b
(f2fs: Disable gcc9 -Waddress-of-packed-member).

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Reviewed-by: Robbie Harwood <rharwood@redhat.com>
grub-core/osdep/windows/platform.c