Subject: Re: Weird alignment bug on gcc/powerpc
To: None <tech-toolchain@netbsd.org>
From: Christos Zoulas <christos@zoulas.com>
List: tech-toolchain
Date: 04/09/2003 13:03:29
In article <HD2upz.IKn@tac.nyc.ny.us>,
Christos Zoulas <christos@tac.gw.com> wrote:
>In article <Pine.NEB.4.53.0304091151480.630@oor-wullie.mctavish.co.uk>,
>Steve Woodford <scw@wasabisystems.com> wrote:
>
>Hi Steve,
>
>This is the first time I see an aligned attribute applied to a typedef.
>This is usually applied to a variable instance. I can understand what
>the intent is, i.e. to make all imask_t instances appropriately aligned,
>but I would not be surprised, if the compiler just saw this as a request
>to align all u_int32_t's. If that is the case, it should be fixed to do
>the former.
>
>christos

And shouldn't the typedef be:

typedef struct {
	__uint32_t __bits[4];
} imask_t __attribute__((__aligned__(16));

It seems cleaner to me.

christos