Message-Id: <199605090738.DAA00982@delorie.com> Date: Thu, 09 May 96 10:32:35 LIT From: Martynas Kunigelis Subject: Re: Structure size To: DJGPP mailing list On Thu, 9 May 96 03:15:00 UTC 0000 you said: > >P.S.: If you are using C++, the above will not work correctly due to a bug in >gcc. To make it work, you have to surround your code with #pragma pack(1) >and #pragma pack(). > >John Actually, the above will not even compile under G++. The docs say to append __attribute__ ((packed)) to the end of every field, not the structure declaration. However, your approach works with GNU C, though it is not documented. GNU C++ does not accept it. I like your approach ( no extra typing ) and I think G++ does not understand it due to a bug. I've reported this to gcc bug list. Martynas