Overzealous alignment and padding

Colin Denman "GECCL" cd at hrc63.co.uk
Tue Nov 1 04:32:53 AEST 1988


In article <7613 at bloom-beacon.MIT.EDU>, scs at athena.mit.edu (Steve Summit) writes:
> In article <410 at sdrc.UUCP> scjones at sdrc.UUCP (Larry Jones) writes:
> >[...]
> 
> As was discussed recently in this newsgroup, you can avoid all
                                                             ^^^
> structure arrangement problems by simply not attempting to
> conform to external binary formats, but by using an external text
> file format instead.  (Efficiency hackers find this solution
> unpalatable, but the parse time and file size issues are often
> not real problems in practice.)

My most frequent problems with  enforced  alignments  occur  with
*hardware*  formats  and  ones over which I have no control. What
external text format do I use for them :->.

If my machine doesn't  have  floating  point  hardware,  I  still
expect  a  worthy  C  implementation  to  simulate  with  loss of
efficiency. Why can't the same attitude be adopted to matters  of
alignments  and  bit-manipulations. It would be neat and portable
if I could express a format (bitfields and  all)  secure  in  the
knowledge  that  the  only  thing  I  loose  is efficiency. If my
solution permits, I can optimise data layouts, but at least I get
something that *works*.

It is not just a problem  for  "efficiency  hackers",  quite  the
opposite.

		Colin J Denman



More information about the Comp.lang.c mailing list