Problems with GCC and/or VAX LINK

Karl Heuer karl at haddock.ima.isc.com
Fri Mar 17 12:35:18 AEST 1989


In article <1732 at levels.sait.edu.au> ccdn at levels.sait.edu.au (DAVID NEWALL) writes:
>A program section which is conditionally _not_ compiled should be treated
>like a comment -- it shouldn't matter what's inside the #ifdef/#endif.

The following is legal C code:
	char *x="\
	#endif" /*
	#ifdef foo */
It has always been legal to enclose such code in an #if/#endif.  Your
suggestion would break this.

If you want to prevent sections of code from being compiled, use #if/#endif.
If you want to include descriptive text, use a comment.

Btw, you said `#ifdef 0'; this should be `#if 0' (or that godawful pdp11ism
`#ifdef notdef')

Karl W. Z. Heuer (ima!haddock!karl or karl at haddock.isc.com), The Walking Lint



More information about the Comp.lang.c mailing list