Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!dali.cs.montana.edu!ogicse!intelhf!ichips!inews!pima!bhoughto From: bhoughto@pima.intel.com (Blair P. Houghton) Newsgroups: comp.lang.c Subject: Re: Non-compiled source text? Message-ID: <1422@inews.intel.com> Date: 17 Dec 90 00:27:54 GMT References: <2061@mountn.dec.com> <542@taumet.com> Sender: news@inews.intel.com Organization: Intel Corp, Chandler, AZ Lines: 50 In article <542@taumet.com> steve@taumet.com (Stephen Clamage) writes: >minow@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?"