RE: packing fun

"Daniel Vogel" <[email protected]>
Newsgroups gmane.games.devel.general
Message-ID <[email protected]>
As a follow up,

We were seeing the odd behaviour with variants of gcc 3.1 we used for the
Linux64 and Mac port. The 3.3 series of gcc packs the same way as VS.NET and
2.95.3 so I assume it was a regression.

I couldn't find anything in the documentation but Microsoft confirmed that
VS.NET leaves the padding on base types untouched when allocating space for
new members in the derived type.

-- Daniel, Epic Games Inc.  

> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On 
> Behalf Of Daniel Vogel
> Sent: Wednesday, December 24, 2003 8:36 PM
> To: [email protected]
> Subject: [GD-General] packing fun
> 
> Packing fun.
> 
> // both gcc 3.0 and VS.NET support the pack pragma
> #pragma pack(4)
> 
> struct Alice
> {
> 	int Integer1;
> 	char Char1;
> };
> 
> struct Bob : Alice
> {
> 	char Char2;
> };
> 
> gcc 3.0 
> sizeof(Alice)==sizeof(Bob)==8 and funnier enough, 
> STRUCT_OFFSET(Char2) <
> sizeof(Alice)
> 
> VS.NET 2003
> sizeof(Alice)==8, sizeof(Bob)==12
> 
> Is anyone aware of in-detail documentation on variable 
> packing for both gcc
> and VS.NET?
> 
> Thanks,
> 
> -- Daniel, Epic Games Inc.
> 
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: IBM Linux Tutorials.
> Become an expert in LINUX or just sharpen your skills.  Sign 
> up for IBM's
> Free Linux Tutorials.  Learn everything from the bash shell 
> to sys admin.
> Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
> _______________________________________________
> Gamedevlists-general mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/gamedevlists-general
> Archives:
> http://sourceforge.net/mailarchive/forum.php?forum_id=557
> 



-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Gamedevlists-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gamedevlists-general
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_id=557
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.