Hi,

I've got a problem with msp430-gcc structure sizes / packing:

When compiling the following code with a newer version of mspgcc (e. g. 
mspgcc-20081230.exe or a topic cvs-build) the variable xaver is six byte in 
memory:

typedef struct {
   struct {
     unsigned a  : 1;     
     unsigned b : 1;
     unsigned c : 1;
     unsigned d : 1;
     unsigned e : 4;
   } BIT;
  unsigned char x;
  unsigned int  y;
} mytype;

mytype xaver;

int main() {
}

When compiling it with an older version (e. g. mspgcc-20080619.exe), xaver has 
only a size of four bytes.

Can anybody explain me why?
Can I avoid packing the new way?

Thanks for your help and best regards.

-- 
Neu: GMX FreeDSL Komplettanschluss mit DSL 6.000 Flatrate + Telefonanschluss 
für nur 17,95 Euro/mtl.!* 
http://dslspecial.gmx.de/freedsl-surfflat/?ac=OM.AD.PD003K11308T4569a

Reply via email to