Resent-Message-Id: <199603181506 DOT KAA05147 AT delorie DOT com> Message-Id: <199603181506.KAA05147@delorie.com> Resent-Date: Mon, 18 Mar 96 17:06:22 LIT Resent-From: Martynas Kunigelis Resent-To: DJGPP mailing list Date: Mon, 18 Mar 96 14:34:33 LIT From: Martynas Kunigelis Subject: Re: Packed Align bug in G++ 2.7.2?? To: DJGPP mailing list In-Reply-To: Your message of 14 Mar 1996 18:26:33 GMT To correct the buggy G++ 2.7.2 behaviour when packing structures, use: #pragma pack(1) /* align by 1 byte boundary */ struct my_struct { short a; char b; /* offset 2 */ int b; /* offset 3 */ }; #pragma pack() /* restore default alignment */ if the structure is defined in a header file, do: #pragma pack(1) #include #pragma pack() ..hope this helps. Martynas Kunigelis