This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: __attribute__ ((aligned)) weirdness
Andrew Haley wrote:
Piotr Wyderski writes:
> > So you have a field at offset 4. You ask for it to be 4-aligned, and
> > it jumps to offset 8.
> >
> > What is going on?
>
> The alignment of x means that the offset of a variable is divisible
> by x with no remainder. Each y=x*2^n (where n is natural) is
> a good alignment too, because f mod y = 0 => f mod x = 0;
> 8-aligned field is also 4-aligned. So where's the problem?
I need to know why this happens.
Could this be related? No explanation, sorry.
http://gcc.gnu.org/ml/gcc/2003-02/msg00353.html
Andreas