bitfields considered harmful?

T. William Wells bill at twwells.uucp
Sun Apr 30 05:26:35 AEST 1989


In article <1473 at uwbull.uwbln.UUCP> ckl at uwbln.UUCP (Christoph Kuenkel) writes:
: We have some software using C bitfields like in
:
:       struct ... {
:               unsigned        active : 1,
:                               waiting : 1;
:               ...
:       };
:
: During various ports of that to different SysV machines (should i have posted
: that to comp.unix.wizards?) we ran into problems because of compiler bugs.
: One time, assembler code was produced that tried to shift a word 0 bits to the
: right (68020), another time bitfields read nonzero all the time (iapx386),

Long ago, we at Proximity decided that bit field implementations were
flakey enough that we weren't going to use them.

I see that time hasn't changed this.

Sigh. Bit fields are such a nice idea.

---
Bill                            { uunet | novavax } !twwells!bill



More information about the Comp.lang.c mailing list