From e416c1036f6119b062ca239142b6759cb1f70276 Mon Sep 17 00:00:00 2001 From: Michael Chang Date: Mon, 26 Mar 2018 16:52:34 +0800 Subject: [PATCH] Fix packed-not-aligned error on GCC 8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building with GCC 8, there are several errors regarding packed-not-aligned. ./include/grub/gpt_partition.h:79:1: error: alignment 1 of ‘struct grub_gpt_partentry’ is less than 8 [-Werror=packed-not-aligned] This patch fixes the build error by cleaning up the ambiguity of placing aligned structure in a packed one. In "struct grub_btrfs_time" and "struct grub_gpt_part_type", the aligned attribute seems to be superfluous, and also has to be packed, to ensure the structure is bit-to-bit mapped to the format laid on disk. I think we could blame to copy and paste error here for the mistake. In "struct efi_variable", we have to use grub_efi_packed_guid_t, as the name suggests. :) Signed-off-by: Michael Chang Tested-by: Michael Chang Tested-by: Paul Menzel Reviewed-by: Daniel Kiper --- include/grub/gpt_partition.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/grub/gpt_partition.h b/include/grub/gpt_partition.h index 466735134..6afaee5a1 100644 --- a/include/grub/gpt_partition.h +++ b/include/grub/gpt_partition.h @@ -91,7 +91,7 @@ struct grub_gpt_header struct grub_gpt_partentry { - grub_gpt_part_type_t type; + grub_gpt_guid_t type; grub_gpt_guid_t guid; grub_uint64_t start; grub_uint64_t end;