Non-compiled source text?

Henry Spencer henry at zoo.toronto.edu
Mon Dec 17 08:34:03 AEST 1990


In article <2061 at mountn.dec.com> minow at bolt.enet.dec.com (Martin Minow) writes:
>... 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."

You have omitted an important fine point:  if ' or " occurs in such a
context that it can only fall under that last item, the effect is undefined.
So a compiler is entitled to reject such text.

>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?

To skip sections of *source* files conditionally.  There is no implication
that the skipped sections can contain arbitrary trash.  The C preprocessor
is not a general-purpose macro processor.
-- 
"The average pointer, statistically,    |Henry Spencer at U of Toronto Zoology
points somewhere in X." -Hugh Redelmeier| henry at zoo.toronto.edu   utzoo!henry



More information about the Comp.lang.c mailing list