This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: __attribute__ ((aligned)) weirdness


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.

Andrew.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]