32 bit longs

Doug McDonald mcdonald at aries.scs.uiuc.edu
Fri Jan 25 01:22:35 AEST 1991


In article <1348 at geovision.UUCP> pt at geovision.uucp (Paul Tomblin) writes:
>bright at 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



More information about the Comp.lang.c mailing list