negative addresses

Dave Jones djones at megatest.UUCP
Tue May 24 16:08:21 AEST 1988


in article <959 at unisoft.UUCP}, paul at unisoft.UUCP (n) says:

} 			   if (x) ...
} 
} 	really means 	   if (x != 0) ....
} 	which really means if ((x != 0) != 0) ...
} 	which really means if (((x != 0) != 0) != 0) ...
} 	which really means if ((((x != 0) != 0) != 0) != 0) ...
} 
} 				etc etc
} 
} 
} hence the need for all these new super optimising compilers .....
} 


Love it.  You made my day.

Have you ever put two packages together, and cpp says "FALSE redefined"?

That means that not one, but TWO, count 'em, TWO .h files have a
macro like

#define FALSE (0!=0)

and they aren't the same.

In the code, you're likely to see 

	if( x == FALSE )

which translates to

	if( x == (0!=0) )

which, in C,  ain't the same as if( !x ).  I call this the
"Law of the Included Muddle".

Now if they had just written the macro that way, we'd have this:

#define FALSE ((0!=0)!=FALSE)

Now we've *really* got something for your optimizing compilers to crunch on.

  if(x != ((0!=0)!=((0!=0)!=((0!=0)!= ... 

I wonder if the TRUE-believers figure that someday they'll need to redefine
TRUE to -- oh let's see -- maybe 42?



		-- Dave J.



More information about the Comp.lang.c mailing list