bitfields

Wayne Throop throopw at dg_rtp.UUCP
Tue Dec 2 02:18:09 AEST 1986


(Note that this discussion in more properly a language discussion, not
 an OS discussion.  I've therefore cross-posted, and set the followup to
 comp.lang.c.)

> wmam at sphinx.UChicago.UUCP (tony mason)
> [...] how are bit fields in C dealt with?  As I read K&R arrays of bit
> fields are allowed [...].  Has X3J11 come up with anything regarding
> this? [...]

Since K&R define array subscripting in terms of pointer arithmetic, and
since taking the address of a bitfield is not allowed by K&R, how can
you possibly conclude that bitfield arrays are allowed?  Breifly,
paraphrasing a lof of what I find in X3J11, bitfield definitions are
legal only on struct members of integral type.  Harbison and Steele warn
that some compilers only allow bitfield modifiers on *unsigned* integral
typed struct members.  K&R say similar things.  So again... what passage
in K&R led you to think that arrays of bitfields were sensible in C?

--
Sometimes I think the only universal in the computing field is the
fetch-execute cycle.
                                --- Alan J. Perlis
-- 
Wayne Throop      <the-known-world>!mcnc!rti-sel!dg_rtp!throopw



More information about the Comp.lang.c mailing list