www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/12/10:07:19

Date: Sat, 12 Apr 1997 16:40:18 -0300
Message-Id: <9704121940.AA20198@eed.miee.ru>
From: "Oleg Yu. Polyanski" <luke AT eed DOT miee DOT ru>
To: Anthony DOT Appleyard AT umist DOT ac DOT uk
Cc: djgpp AT delorie DOT com
Subject: Re: Problem with Packed structs
In-Reply-To: <AEA78966EE@fs2.mt.umist.ac.uk>
References: <AEA78966EE AT fs2 DOT mt DOT umist DOT ac DOT uk>

Anthony Appleyard writes:
 >   "Oleg Yu. Polyanski" <luke AT eed DOT miee DOT ru> wrote:-
 > > Well, I see no reasons to use packed structures *at all*. This way is
 > > unportable between different platforms and often even between different
 > > compilers on the same platform. ... `-fpack-struct' ...
 > 
 >   (1) When calling an interrupt, I often need to declare a packed struct which
 > matches the layout of the data needed or provided by the interrupt.

	oh.... when I wrote my previous letter (about packed
structures) I forgot all about other cases, when portability isn't
primary task or when programmer should use DOS internal structures etc
Yesterday I wrote such programm (to recover data from my DOS partition with
destroyed root directory) and I've used -fpack-struct :-) So please
excuse me for too harsh answer....

 >   (2)  If I am declaring `struct(long i; char c;} X[0x4000];', having 5 rather
 > than 8 bytes in each array element can save a lot of space.

	You'll have big performance penalties applying `packed'
attribute to this structure.

-- 
Sincerely yours, necrofriend.

- Raw text -


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