Skip to content

Commit

Permalink
Fix alignment of some data structures
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ani-sinha committed Jun 2, 2022
1 parent caeccd8 commit 80547f6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion grub-core/fs/btrfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ struct grub_btrfs_time
{
grub_int64_t sec;
grub_uint32_t nanosec;
} __attribute__ ((aligned (4)));
} __attribute__ ((packed));

struct grub_btrfs_inode
{
Expand Down
2 changes: 1 addition & 1 deletion include/grub/acpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ struct grub_acpi_madt
grub_uint32_t lapic_addr;
grub_uint32_t flags;
struct grub_acpi_madt_entry_header entries[0];
};
} __attribute__ ((packed));

enum
{
Expand Down
2 changes: 1 addition & 1 deletion include/grub/gpt_partition.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct grub_gpt_part_type
grub_uint16_t data2;
grub_uint16_t data3;
grub_uint8_t data4[8];
} __attribute__ ((aligned(8)));
} __attribute__ ((packed));
typedef struct grub_gpt_part_type grub_gpt_part_type_t;

#define GRUB_GPT_PARTITION_TYPE_EMPTY \
Expand Down

0 comments on commit 80547f6

Please sign in to comment.