From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Tue, 5 Jun 2007 17:43:09 -0700 From: Roman Shaposhnick Subject: Re: [9fans] quiz In-reply-to: <13426df10706051736q4e1852a9g3f54d8f6e2d182b4@mail.gmail.com> To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Message-id: <1181090589.4241.41.camel@work.sfbay.sun.com> MIME-version: 1.0 Content-type: text/plain Content-transfer-encoding: 7BIT References: <13426df10706051736q4e1852a9g3f54d8f6e2d182b4@mail.gmail.com> Topicbox-Message-UUID: 798d34b2-ead2-11e9-9d60-3106f5b1d025 On Tue, 2007-06-05 at 17:36 -0700, ron minnich wrote: > /* catch the bug */ > > struct x { > int botch:1; > }; > > fun(){ > struct x x; > x.botch = 0; > x.botch = 1; > } > > ok, what's the bug? anyone? I just found this out today. (no, I don't > use bitfields, but insane people do) signed vs. unsigned int perhaps (meaning that x.botch becomes < 0 after the last assignment) ? Thanks, Roman.