prev up next   top/contents search

comp.lang.c FAQ list · Question 11.19

Q: I'm getting strange syntax errors inside lines I've #ifdeffed out.

A: Under ANSI C, the text inside a ``turned off'' #if, #ifdef, or #ifndef must still consist of ``valid preprocessing tokens.'' This means that the characters " and ' must each be paired just as in real C code, and the pairs mustn't cross line boundaries. (Note particularly that an apostrophe within a contracted word looks like the beginning of a character constant.) Therefore, natural-language comments and pseudocode should always be written between the ``official'' comment delimiters /* and */. (But see question 20.20, and also 10.25.)

References: ISO Sec., Sec. 6.1
H&S Sec. 3.2 p. 40

prev up next   contents search
about this FAQ list   about eskimo   search   feedback   copyright

Hosted by Eskimo North