Message-ID: <000e01c0f7eb$4e4fc600$910fa2cb@lunar> From: "Lunar" To: "Eli Zaretskii" Cc: References: Subject: Re: BIG problem with structure alignment! Date: Mon, 18 Jun 2001 18:38:12 +0700 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Reply-To: djgpp AT delorie DOT com I've read the FAQ. It says if I add an "-fpack-struct" command line option, GCC will not align the struct. But in fact, when I try that, sizeof() still report 4 bytes as it did before. Can you help, please? ----- Original Message ----- From: Eli Zaretskii To: Lunar Cc: Sent: Monday, June 18, 2001 2:15 PM Subject: Re: BIG problem with structure alignment! > > On Mon, 18 Jun 2001, Lunar wrote: > > > I've met this problem with structure declaration: > > I did have a struct like this: > > struct T1{ > > char _t1; > > short _t2; > > }; > > > > and the sizeof(T1) return a result of 4, instead of 3 as I expected. Why = > > is that? If it's because of some aligment option, then could you help me = > > turn them off? > > Please see section 22.11 of the DJGPP FAQ list, it explains this > issue. > > And please don't post in HTML.