www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/11/10:00:32

Date: Fri, 11 Apr 1997 16:34:40 -0300
Message-Id: <9704111934.AA20072@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: <97C5A0152C@fs2.mt.umist.ac.uk>
References: <97C5A0152C AT fs2 DOT mt DOT umist DOT ac DOT uk>

Anthony Appleyard writes:
 > "Oleg Yu. Polyanski" <luke AT eed DOT miee DOT ru> replied:-
 > > 	.... or add -fpack-struct option to gcc.
 > 
 >   And the user has to remember to type `-fpack-struct' every time he compiles.
 > It got wearisome enough for me having to remember which programs call maths so
 > I must type `-lm' when compiling them.

	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. By example, if you need to
read data produced (by example) by program compiled with Watcom C
compiler. In Watcom alignement is different depending on optimization
options given to compiler. So, probably, you'll have big problem to
read/write such data. Only in some cases `-fpack-struct' can really
help and programmer should use them very carefully isolating other code.

-- 
Sincerely yours, necrofriend.

- Raw text -


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