[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gcc bug causes parted to write bad GPT entries

From: Andrew Clausen
Subject: Re: gcc bug causes parted to write bad GPT entries
Date: Sat, 16 Mar 2002 12:01:17 +1100
User-agent: Mutt/1.3.17i

On Sat, Mar 16, 2002 at 12:40:31AM +0000, Richard Hirst wrote:
> Another possible option is to simply remove the ((packed)) attribute
> from the struct definition:
> typedef struct {
>         uint32_t time_low;
>         uint16_t time_mid;
>         uint16_t time_hi_and_version;
>         uint8_t  clock_seq_hi_and_reserved;
>         uint8_t  clock_seq_low;
>         uint8_t  node[6];
> } __attribute__ ((packed)) efi_guid_t;
> I don't see why that struct needs the attribute anyway; the members are
> sorted largest first so I wouldn't expect any padding.  If I remove it,
> then gcc sticks a .align 4 before it, and everything appears to be
> happy.  I'll look more closely at that approach over the weekend.

I think ARM's ABI defines everything to be 32bit aligned.
(Where can I check?)

Actually, I think parted breaks on ARM due to gcc bugs ATM.  (Can
someone check?)

Anyway, I don't trust compilers, unless some language lawyer can
prove that it will always work without ((packed)).
Even if the lawyer can prove it, it still seems better (in general)
to put the ((packed)) thing in, to document that we ARE worried
about the physical layout of the struct.  (We could comment that
out in this case, because it tickles a gcc bug, but that's how
I would prefer to do it, anyway)

BTW, what is the bug exactly?


reply via email to

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