grub2/0003-hfs-Fix-gcc9-error-Waddress-of-packed-member.patch
Michael Chang 591f180452 Accepting request 700268 from home:michael-chang:branches:Base:System
- Fix GCC 9 build failure (bsc#1121208)
  * 0001-cpio-Disable-gcc9-Waddress-of-packed-member.patch
  * 0002-jfs-Disable-gcc9-Waddress-of-packed-member.patch
  * 0003-hfs-Fix-gcc9-error-Waddress-of-packed-member.patch
  * 0004-hfsplus-Fix-gcc9-error-with-Waddress-of-packed-membe.patch
  * 0005-acpi-Fix-gcc9-error-Waddress-of-packed-member.patch
  * 0006-usbtest-Disable-gcc9-Waddress-of-packed-member.patch
  * 0007-chainloader-Fix-gcc9-error-Waddress-of-packed-member.patch
  * 0008-efi-Fix-gcc9-error-Waddress-of-packed-member.patch

OBS-URL: https://build.opensuse.org/request/show/700268
OBS-URL: https://build.opensuse.org/package/show/Base:System/grub2?expand=0&rev=332
2019-05-03 03:07:30 +00:00

38 lines
1.5 KiB
Diff

From 0e49748fad8e036d9875785e57c577214e699941 Mon Sep 17 00:00:00 2001
From: Michael Chang <mchang@suse.com>
Date: Thu, 11 Apr 2019 17:14:04 +0800
Subject: [PATCH 3/8] hfs: Fix gcc9 error -Waddress-of-packed-member
Simply adds the missing packed attribute to 'struct grub_hfs_extent'.
[ 83s] ../grub-core/fs/hfs.c: In function 'grub_hfs_iterate_records':
[ 83s] ../grub-core/fs/hfs.c:699:9: error: taking address of packed member of 'struct grub_hfs_sblock' may result in an unaligned pointer value [-Werror=address-of-packed-member]
[ 83s] 699 | ? (&data->sblock.catalog_recs)
[ 83s] | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 83s] ../grub-core/fs/hfs.c:700:9: error: taking address of packed member of 'struct grub_hfs_sblock' may result in an unaligned pointer value [-Werror=address-of-packed-member]
[ 83s] 700 | : (&data->sblock.extent_recs));
[ 83s] | ~^~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Michael Chang <mchang@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
---
include/grub/hfs.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/grub/hfs.h b/include/grub/hfs.h
index d935f5005..e27993c42 100644
--- a/include/grub/hfs.h
+++ b/include/grub/hfs.h
@@ -29,7 +29,7 @@ struct grub_hfs_extent
/* The first physical block. */
grub_uint16_t first_block;
grub_uint16_t count;
-};
+} GRUB_PACKED;
/* HFS stores extents in groups of 3. */
typedef struct grub_hfs_extent grub_hfs_datarecord_t[3];
--
2.16.4