delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/09/15/13:02:00

Date: Wed, 15 Sep 1999 11:55:46 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Michael Uplawski <uplawski AT sulla DOT franken DOT de>
cc: djgpp AT delorie DOT com
Subject: Re: Generous SIZEOF
In-Reply-To: <2nTeN=6M6HhbMxFDzmQv8Dr+41+2@4ax.com>
Message-ID: <Pine.SUN.3.91.990915115527.27871L-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Tue, 14 Sep 1999, Michael Uplawski wrote:

> >The compiler is rounding up the size of the structure to the nearest
> >four byte boundary, so that accesses are more efficient (particularly
> >when using an array of structures).
> >
> >If you want to prevent this, declare the structure with attribute
> >packed eg:
> (...)
> >} __attribute__((packed));
> >struct CD All[MAX];
> 
> Needless or not, THANK YOU! :-)
> 
> I am rather sure, that I would have otherwise waited a long time for
> this tip to come along.

Please note that this is explained in the DJGPP FAQ list (section
22.10).  Look into the FAQ first, and you will never need to wait a
long time for such tips!

- Raw text -


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