Re: Cohen's paper on byte order

From: Bryan Olson (fakeaddress@nowhere.org)
Date: 04/09/03


From: Bryan Olson <fakeaddress@nowhere.org>
Date: Wed, 09 Apr 2003 04:37:14 GMT

Mok-Kong Shen wrote:

> As an addendum to my previous post, I like to mention
> that the fact that in C one could define a data structure
> to access the individual bits clearly indicates that
> the physical bits in hardware has a natural numerical
> ordering. Therefore in any 8-bit chunk of hardware
> there is a bit with the lowerest address.

Flat out wrong. On most modern machines, the byte is the
smallest addressable unit. In C, bit-fields don't have
addresses. C leaves the layout of bit-fields up to the
compiler. Why wouldn't Shen spend the few minutes to look this
up, or try C's address operator on bit fields before posting
wrong information here?

-- 
--Bryan


Relevant Pages

  • Re: Bit-field union bug
    ... I'm not quite sure what the point of a bitfield is when the compiler is ... The point is that the compiler is *permitted* to coalesce bitfields. ... Actually, it is required to do so, when adjacent bit-fields in the same ... struct fit in a single storage unit. ...
    (comp.lang.c)
  • Re: Multi-instructions macro and compiler warning
    ... generation of the warning. ... On the compiler where the code was first ... developed such bit-fields were unsigned, ... zero or one and the `if' made sense. ...
    (comp.lang.c)
  • Re: sizes of bit fields
    ... I know that it is quite compiler specific, ... > according to the ANSI standard? ... The standard leaves the allocation unit for bit-fields up to the ...
    (comp.lang.c)
  • Re: Bit-field union bug
    ... I'm not quite sure what the point of a bitfield is when the compiler is ... The point is that the compiler is *permitted* to coalesce bitfields. ... Actually, it is required to do so, when adjacent bit-fields in the same ... struct fit in a single storage unit. ...
    (comp.lang.c)
  • Re: bit fields in a structure
    ... > UINT16 word; ... in the way it arranges bit-fields, ... Such use may be appropriate for a particular compiler ...
    (comp.lang.c)