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


> 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?

    Best regards
    Piotr Wyderski



Serwis www.logo.hoga.pl - sciagaj bajery na telefony
Nokia, Siemens, Alcatel, Ericsson, Motorola,Samsung
------------------------------------------------------------
Promocja!!! rabat 40 % na zakup mks_vir 2003 dla klientów Connect , którzy
posiadaja kupony rabatowe.



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