Path: utzoo!attcan!uunet!steinmetz!davidsen
From: davidsen@steinmetz.ge.com (William E. Davidsen Jr)
Newsgroups: comp.lang.c
Subject: Re: Packed structures (was: Absolute size of 'short')
Message-ID: <11868@steinmetz.ge.com>
Date: 16 Aug 88 17:07:42 GMT
References: <214@ISIDAPS5.UUCP> <9641@dartvax.Dartmouth.EDU> <62505@sun.uucp> <6104@haddock.ISC.COM> <1258@ficc.UUCP>
Reply-To: davidsen@crdos1.UUCP (bill davidsen)
Organization: General Electric CRD, Schenectady, NY
Lines: 29

In article <1258@ficc.UUCP> peter@ficc.UUCP (Peter da Silva) writes:
| In article <6104@haddock.ISC.COM>, karl@haddock.ISC.COM (Karl Heuer) writes:
| > In article ... davidsen@crdos1.UUCP (bill davidsen) writes:
| > >I would really like to see a "packed struct," also. This would be a
| > >struct packed on byte boundaries without fill, no matter *how bad* the
| > >code was to use them.

| It is already illegal to take the address of one object with no legal
| address... a register variable. Why should it be legal to take the address
| of a misaligned integer?

  Thank you for a good solution to the problem to pointers. Obviously if
this was added it would have to be illegal on all machines, not just
those which couldn't hack the addressing.

| Another comment: what about:
| 
| 	packed struct { int a:1; int b; int c:17; } argh;

  Yes, I was careful to say byte alligned for this reason, but I may
not have discussed the rationale. Bit alligned is so rarely useful that
I can see no reason for adding it to the language. Byte alligned is
nice for passing data between machines, such as computers and control
equipment.

-- 
	bill davidsen		(wedu@ge-crd.arpa)
  {uunet | philabs | seismo}!steinmetz!crdos1!davidsen
"Stupidity, like virtue, is its own reward" -me