Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!nstn.ns.ca!news.cs.indiana.edu!know!samsung!sdd.hp.com!decwrl!pa.dec.com!shlump.nac.dec.com!tkou02.enet.dec.com!jit345!diamond From: diamond@jit345.swstokyo.dec.com (Norman Diamond) Newsgroups: comp.lang.c Subject: Re: 32 bit longs Message-ID: <1991Jan22.022206.24691@tkou02.enet.dec.com> Date: 22 Jan 91 02:22:06 GMT References: <14824@smoke.brl.mil> <1991Jan13.182655.17672@athena.mit.edu> <1291@mti.mti.com> <231@nazgul.UUCP> Sender: news@tkou02.enet.dec.com (USENET News System) Reply-To: diamond@jit345.enet@tkou02.enet.dec.com (Norman Diamond) Distribution: comp Organization: Digital Equipment Corporation Japan , Tokyo Lines: 22 In article <231@nazgul.UUCP> bright@nazgul.UUCP (Walter Bright) writes: ------------- !!!!!!!!!!!!! ????????????? >If you have a need for *exactly* 32 bits, you can do things like: > x &= 0xFFFFFFFF; /* truncate result to 32 bits */ >... Alternatively, you can do things like: > if (sizeof(x) == 4) > /* code here depends on 32 bits in x */ On a machine with 36-bit words and C support hacked with 9-bit chars, this test will give an undesired result. On a machine with 16-bit bytes, this test will give an undesired result either way, if x really has 32 bits or if it doesn't. It is hard to believe that Mr. Bright would make this kind of mistake. -- Norman Diamond diamond@tkov50.enet.dec.com If this were the company's opinion, I wouldn't be allowed to post it.