Alignment (was: Structure Member Padding)
Joseph S. D. Yao
jsdy at hadron.COM
Fri Aug 10 07:11:51 AEST 1990
In article <1990Aug8.012908.28364 at sq.sq.com> msb at sq.sq.com (Mark Brader) writes:
>1.6 says that any object is a contiguous sequence of bytes, each of which
>is individually addressable. 3.3.3.4 forces the size of type char to be
>exactly 1 byte.
...
>I can't take "contiguously allocated" to mean anything else but that
>the object declared by "char y[4];" occupies exactly 4 bytes, which have
>consecutive addresses; sizeof y must be 4.
In recent years, for some reason, people have been assuming that "byte"
means "eight bits" (bit = binary unit of information). The more
general definition that I learned at the beginning of my introduction
to computers was that it was a group of [contiguous] bits. This was
reinforced by the existence of byte-handling instructions on machines
like the now-venerable PDP-10 and its successors. For these instruc-
tions, one had to specify not only a byte address, but also a starting
bit and a size (0-36).
I am sure that the ANSI standard has a reasonable definition of "byte",
probably the one that Doug gave ... from where I'm sitting, I just
can't see a copy of it ...
Joe Yao jsdy at hadron.COM
( jsdy%hadron.COM@{uunet.UU.NET,decuac.DEC.COM} )
arc,arinc,att,avatar,blkcat,cos,decuac,\
dtix,ecogong,grebyn,inco,insight,kcwc, \
lepton,lsw,netex,netxcom,phw5,research, >!hadron!jsdy
rlgvax,seismo,sms,smsdpg,sundc,telenet, /
uunet /
(Last I counted ...)
More information about the Comp.std.c
mailing list