www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/06/18/08:07:12

Message-ID: <000e01c0f7eb$4e4fc600$910fa2cb@lunar>
From: "Lunar" <lunarorb AT hn DOT vnn DOT vn>
To: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Cc: <djgpp AT delorie DOT com>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1010618101450 DOT 22931Q-100000 AT is>
Subject: Re: BIG problem with structure alignment!
Date: Mon, 18 Jun 2001 18:38:12 +0700
MIME-Version: 1.0
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 <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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019