grub-devel
[Top][All Lists]
Advanced

[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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]