Alignment (was: Structure Member Padding)

Doug Gwyn gwyn at smoke.BRL.MIL
Sat Aug 11 06:25:55 AEST 1990


In article <904 at hadron.COM> jsdy at hadron.UUCP (Joseph S. D. Yao) writes:
>I am sure that the ANSI standard has a reasonable definition of "byte",

The C standard defines "byte" and "char" as effectively synonymous;
although they have slightly different connotations, they occupy the
same space and "really" mean exactly the same thing.  There have to
be at least 8 bits in a char|byte, but it may be larger than that;
the implementor gets to decide on the exact size.  I suspect that
almost every implementation on machines that support direct
addressing of 8-bit bytes will make char|byte an 8-bit Yao-byte
(meaning: 8 contiguous bits).  The Yao definition for "byte" is what
I would consider correct for general usage, and it is consistent with
the usage in the C standard.  The notion that a byte has to be exactly
8 bits was probably due to the prevalence of 8-bit chunk-addressable
systems (System/360, PDP-11, Nova, VAX, 8080, 6800, ...) and to
ignorance of the existence of non-8-bit systems.  After all, 8 bits
is enough to represent any character with one bit left over for
parity, isn't it?  (Rhetorical question, the answer is "not really".)



More information about the Comp.std.c mailing list