The last note:
if bitfield in SDCC for the first time crosses byte boundary, it always 
starts at bit zero. The strange thing is that second example produces 3 
byte long structure (no 4 bytes long) so second byte-boundary crossing 
seems working correctly.

// correct
struct {
   unsigned int bit1:3;
   unsigned int bit2:5;
   // byte boundary
   unsigned int bit3:7;
   unsigned int bit4:1;
} struct1;

// wrong
struct {
   unsigned int bit1:3;
   // byte boundary, next field doesn't continue in first byte of structure
   unsigned int bit2:6;
   unsigned int bit3:6;
   unsigned int bit4:1;
} struct2;

These two structures don't generate same result: sizeof(struct1) = 2 
while sizeof(struct2) = 3...

Hynek


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to