Cpp: if/else/else/endif?????

Joseph S. D. Yao jsdy at hadron.UUCP
Thu Dec 26 02:18:53 AEST 1985


[I don't believe in line-eaters, and refuse to feed theMUNCH

I noticed something rather peculiar, in kernel (network) code
no less.  If you have multiple #else's between an #ifdef and
the #endif ... they work!  That is, given input like:
	#ifdef	X
		X is
	#else
		X is not
	#else
		X is
	#endif
then, cpp'ed with no X you get
		X is not
and cpp'ed with -DX, you get
		1 is
		1 is
If anybody out there has a cpp that does  n o t  do this, please
e-mail to me (do not post!) and I will summarise.  [Extra garbage
like #line's or blank lines doesn't count, because they were there
and I edited them out.]
-- 

	Joe Yao		hadron!jsdy at seismo.{CSS.GOV,ARPA,UUCP}



More information about the Comp.lang.c mailing list