Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!usc!wuarchive!bcm!dimacs.rutgers.edu!rutgers!njin!princeton!phoenix.Princeton.EDU!pfalstad From: pfalstad@phoenix.Princeton.EDU (Paul Falstad) Newsgroups: comp.lang.c Subject: Re: 32 bit longs Message-ID: <5658@idunno.Princeton.EDU> Date: 24 Jan 91 18:02:32 GMT References: <1291@mti.mti.com> <231@nazgul.UUCP> <1991Jan24.142235.24668@ux1.cso.uiuc.edu> Sender: news@idunno.Princeton.EDU Organization: The E. Henry Thripshaw Fan Club Lines: 38 mcdonald@aries.scs.uiuc.edu (Doug McDonald) wrote: > >In article <1348@geovision.UUCP> pt@geovision.uucp (Paul Tomblin) writes: >>bright@nazgul.UUCP (Walter Bright) writes: >>> if (sizeof(x) == 4) >>> /* code here depends on 32 bits in x */ >>> ... >>> else >>> /* Portability alert! */ >>> assert(0); /* rewrite this algorithm! */ >>What could possibly be the advantage of that code over the following?: >> /* If this assertion fails, port to another machine or rewrite! */ >> assert(sizeof(x) == 4); >Because the original will alert the reader when sizeof(x) is 4 but >x has 64 bits. OR where sizeof(x) is 4 but x has 36 bits. What? I don't get it. The original code: if (sizeof(x) == 4) ... else assert(0); is the same as if (!(sizeof(x) == 4)) assert(0); ... which is the same as assert(sizeof(x) == 4); -- Paul Falstad, pfalstad@phoenix.princeton.edu PLink:HYPNOS GEnie:P.FALSTAD "And she's always on about men following her. I don't know what she thinks they're going to do to her. Vomit on her, Basil, says."-Flowery Twats