delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/09/14/15:01:46

From: Michael Uplawski <uplawski AT sulla DOT franken DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Generous SIZEOF
Date: Tue, 14 Sep 1999 18:18:55 +0200
Organization: KNF e.V.
Lines: 22
Message-ID: <2nTeN=6M6HhbMxFDzmQv8Dr+41+2@4ax.com>
References: <SorbN=5UcIH2MGzMvvfmX1yTuevV AT 4ax DOT com> <37dbad8f DOT 30594879 AT newsserver DOT cc DOT monash DOT edu DOT au>
NNTP-Posting-Host: sulla.franken.de
Mime-Version: 1.0
X-Trace: chico.franken.de 937326016 73214 193.175.24.189 (14 Sep 1999 16:20:16 GMT)
X-Complaints-To: newsmaster AT franken DOT de
NNTP-Posting-Date: 14 Sep 1999 16:20:16 GMT
X-Newsreader: Forte Agent 1.6/32.525
X-No-Archive: yes
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

DavMac AT iname DOT com (Davin McCall) 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.

MIchael.
-- 
Whatever you do,
try to have a reason to do it.
(Winston Groom - Forrest Gump)

- Raw text -


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