-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hynek Sladky schrieb: > I think it is a bug because: > > struct { > unsigned short CCC:12; > unsigned short READ_BL_LEN:4; > } CSD; > ----> works as expected (2 bytes long) > > struct { > unsigned short READ_BL_LEN:4; > unsigned short CCC:12; > } CSD; > ----> works wrong (3 bytes long) > > I think that this should work the same way shouldn't it?
AFAIk compilers may align larger struct members to different from smaller ones (like aligning ints to 16 bit boundaries, aligning bytes to 8 bit boundaries). I suppose it's the sme for bitfields. Philipp -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGoMJ3btUV+xsoLpoRAntAAJ9eimXP9rQwxreLmlAlmd9tHXQ/rACg5CAm Fs6R4XfPrg9+1oUQ0BkxCCw= =xebT -----END PGP SIGNATURE----- ------------------------------------------------------------------------- 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