www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/08/02/14:18:32

Xref: news-dnh.mv.net comp.os.msdos.djgpp:1329
Path: news-dnh.mv.net!mv!news.sprintlink.net!EU.net!i2unix!news
From: mc5686 AT mclink DOT it (Mauro Condarelli)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: To pack or not to pack
Date: Wed, 02 Aug 1995 15:28:24 GMT
Lines: 31
References: <DCFH6K DOT Fy8 AT jade DOT mv DOT net>
Nntp-Posting-Host: 192.106.166.213
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Dj-Gateway: from newsgroup comp.os.msdos.djgpp

Frank Donahoe <fdonahoe AT wilkes1 DOT wilkes DOT edu> wrote:

>If one is writing rather than porting the code, IMHO the sensible course
>is to pack the structure oneself.  Appropriate use can almost always be
>found for a stray byte or word reserved for future use, and anyone who
>needs to port the code will have no confusion as to where a piece of the
>structure is located.
If you read/write structures directly you will ALWAYS to know the internals
of your compiler.  
The operation is inherently non-portable.
Just think of the different representation for `int'.
On some computers the internal repreentation is NOT what you would expect
(old UNIVAC 1100 had 36bit words, CDC had 60bit words, on some machines the
internal representation of NULL is not a word of all zeroes, you get
big-endians and little-endians and, of course, the VAX little-big-endian :)
:) :) ...)
What you, and some other people, seem to say is:
"Please conform to Microsoft/Borland way of doing things."
This *could* be done, but (IMHO) is the WrongWayAround, since those standards
come stright from the 8bit 8080/Z80 world, adapted to 16bit 8086 and streched
to cover the 32bit 386+.
The only thing i would to see in gcc is a way to pack awhole struct without
having to repeat __attribute__ ((packed)) for each component. (Yes i know i'm
lazy)

>Frank Donahoe
Best Regards


Mauro Condarelli (mc5686 AT mclink DOT it)

- Raw text -


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