Skip to content

Commit ad45238

Browse files
committed
Fix alignment of some data structures
This fixes the alignment of some data strructures by making them aligned to eight byte boundaries. This resolves gcc complaints like the following: error: alignment 1 of 'struct grub_btrfs_inode' is less than 8 [-Werror=packed-not-aligned] Signed-off-by: Ani Sinha <ani@anisinha.ca>
1 parent 521b68a commit ad45238

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

grub-core/fs/btrfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ struct grub_btrfs_time
200200
{
201201
grub_int64_t sec;
202202
grub_uint32_t nanosec;
203-
} __attribute__ ((aligned (4)));
203+
} __attribute__ ((packed));
204204

205205
struct grub_btrfs_inode
206206
{

include/grub/acpi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ struct grub_acpi_madt
8484
grub_uint32_t lapic_addr;
8585
grub_uint32_t flags;
8686
struct grub_acpi_madt_entry_header entries[0];
87-
};
87+
} __attribute__ ((packed));
8888

8989
enum
9090
{

include/grub/gpt_partition.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ struct grub_gpt_part_type
2828
grub_uint16_t data2;
2929
grub_uint16_t data3;
3030
grub_uint8_t data4[8];
31-
} __attribute__ ((aligned(8)));
31+
} __attribute__ ((packed));
3232
typedef struct grub_gpt_part_type grub_gpt_part_type_t;
3333

3434
#define GRUB_GPT_PARTITION_TYPE_EMPTY \

0 commit comments

Comments
 (0)