32 bit longs

Paul Falstad pfalstad at phoenix.Princeton.EDU
Fri Jan 25 05:02:32 AEST 1991


mcdonald at aries.scs.uiuc.edu (Doug McDonald) wrote:
>
>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 */
>>>		...
>>>	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 at 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



More information about the Comp.lang.c mailing list