[EMAIL PROTECTED] wrote:
> I found problem in structure packing in mingw32ce.
> Here is output from wa.c file compiled by mingw32ce :
> sizeof(t1) = 12
> (t1)offset f2 =4
> (t1)offset f3 =8
> (t1)offset f4 =9
> sizeof(t2) = 16
> (t2)offset f2 =4
> (t2)offset f3 =12
> (t2)offset f4 =13
> 
> Output (Visual C) :
> sizeof(t1) = 12
> (t1)offset f2 =4
> (t1)offset f3 =8
> (t1)offset f4 =9
> sizeof(t2) = 24
> (t2)offset f2 =8
> (t2)offset f3 =16
> (t2)offset f4 =17
> 
> When structure doesn't contain long long field everything is OK, but when 
> structure contain such field
> in visual c integer types like (unsigned short) occupies 8 bytes (in 
> mingw32ce 4 bytes).
> Is this a bug ?,or is there  a compiler (switch / directive ) to walk around 
> this problem?
> 

Outch!  Looks like a bug alright.

It seems long long's in structures require 64-bit alignment.  You should be
able to work around it for now by introducing a dummy before f2.

Cheers,
Pedro Alves


-------------------------------------------------------------------------
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/
_______________________________________________
Cegcc-devel mailing list
Cegcc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cegcc-devel

Reply via email to