Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!novavax!twwells!bill From: bill@twwells.uucp (T. William Wells) Newsgroups: comp.lang.c Subject: Re: bitfields considered harmful? Message-ID: <885@twwells.uucp> Date: 29 Apr 89 19:26:35 GMT References: <1473@uwbull.uwbln.UUCP> Reply-To: bill@twwells.UUCP (T. William Wells) Distribution: comp Organization: None, Ft. Lauderdale Lines: 23 Summary: Expires: Sender: Followup-To: Keywords: In article <1473@uwbull.uwbln.UUCP> ckl@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