Path: utzoo!attcan!uunet!zaphod.mps.ohio-state.edu!know!news.cs.indiana.edu!ux1.cso.uiuc.edu!news From: mcdonald@aries.scs.uiuc.edu (Doug McDonald) Newsgroups: comp.lang.c Subject: Re: 32 bit longs Message-ID: <1991Jan24.142235.24668@ux1.cso.uiuc.edu> Date: 24 Jan 91 14:22:35 GMT References: <1348@geovision.UUCP> <14824@smoke.brl.mil> <1991Jan13.182655.17672@athena.mit.edu> <1291@mti.mti.com> <231@nazgul.UUCP> Sender: news@ux1.cso.uiuc.edu (News) Organization: University of Illinois at Urbana Lines: 25 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 */ Let us assume that it depends on having EXACTLY 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. Doug McDonald