Non-compiled source text?
Blair P. Houghton
bhoughto at pima.intel.com
Mon Dec 17 11:27:54 AEST 1990
In article <542 at taumet.com> steve at taumet.com (Stephen Clamage) writes:
>minow at mountn.dec.com (Martin Minow) writes:
>>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).
>
>Read the standard again. In section 3.8 and 3.8.1 it is made explicit
>that #ifdef and #ifndef must be followed by an identifier and then a
^^^^^ ^^^^^^
These
>newline (other white space excepted). "#if 0" is a syntax error.
^^
are not this
The line
#if 0
is just fine.
However, the line
this doesn't work
contains a single-quote character beginning a
character constant that contains a newline,
in violation of the definition of a character constant.
The relevant citation is (ANSI X3.159-1989, section
3.1.3.4, p. 29, ll. 10-19).
Specifically, line 18 prohibits newlines.
Henry indicated that what's between the conditional
directives isn't necessarily allowed to be any more bogus
than what's before and after them; however, sec. 3.8.1, p.
88, ll. 20-24, seem to indicate that lines not to be
included are skipped. But, sec. 3.8, p. 87, l. 12, uses
the phrase "The implementation can process and skip
sections of source files conditionally," which makes it all
ambiguous. Can it process before skipping? Or skip without
processing? Or what?
--Blair
"Can it, really?"
More information about the Comp.lang.c
mailing list