Mail Archives: djgpp/2001/06/18/08:07:12
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 <eliz AT is DOT elta DOT co DOT il>
To: Lunar <lunarorb AT hn DOT vnn DOT vn>
Cc: <djgpp AT delorie DOT com>
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.
- Raw text -