From 0e49748fad8e036d9875785e57c577214e699941 Mon Sep 17 00:00:00 2001 From: Michael Chang 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 Reviewed-by: Daniel Kiper --- 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