[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 3/8] hfs: fix gcc9 error -Waddress-of-packed-member
From: |
Michael Chang |
Subject: |
[PATCH v2 3/8] hfs: fix gcc9 error -Waddress-of-packed-member |
Date: |
Thu, 11 Apr 2019 17:14:04 +0800 |
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 <address@hidden>
---
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
- [PATCH v2 0/8] fix gcc9 build with -Werror=address-of-packed-member, Michael Chang, 2019/04/11
- [PATCH v2 7/8] chainloader: fix gcc9 error -Waddress-of-packed-member, Michael Chang, 2019/04/11
- [PATCH v2 3/8] hfs: fix gcc9 error -Waddress-of-packed-member,
Michael Chang <=
- [PATCH v2 4/8] hfsplus: fix gcc9 error with -Waddress-of-packed-member, Michael Chang, 2019/04/11
- [PATCH v2 8/8] efi: fix gcc9 error -Waddress-of-packed-member, Michael Chang, 2019/04/11
- [PATCH v2 2/8] jfs: disable gcc9 -Waddress-of-packed-member, Michael Chang, 2019/04/11
- [PATCH v2 5/8] acpi: fix gcc9 error -Waddress-of-packed-member, Michael Chang, 2019/04/11
- [PATCH v2 6/8] usbtest: disable gcc9 -Waddress-of-packed-member, Michael Chang, 2019/04/11
- [PATCH v2 1/8] cpio: disable gcc9 -Waddress-of-packed-member, Michael Chang, 2019/04/11
- Re: [PATCH v2 0/8] fix gcc9 build with -Werror=address-of-packed-member, Daniel Kiper, 2019/04/18