Non-compiled source text?

Martin Minow minow at mountn.dec.com
Sat Dec 15 08:38:07 AEST 1990


A compiler I occassionally use rejected the following source text:

	#if 0
	    this doesn't work
	#endif

complaining of an unterminated character constant.  My reading of the ANSI
standard would permit this (and the compilers I generally use have no
trouble with it).  According to a developer (of a "working" compiler)
I contacted, Section 3.8 says that text between #if and #endif must
consist of "preprocessor tokens."  The last item on the list of preprocessor
tokens in 3.1, is "each non-white-space character that cannot be one
of the above."

The intent of the #if ... #endif is to "skip sections of source files
conditionally" -- this is what I'm doing.  What is the real intent
of the standard?

Martin Minow
minow at bolt.enet.dec.com



More information about the Comp.lang.c mailing list