missing terminating ' character

Brian Dessent brian@dessent.net
Tue Nov 18 17:15:00 GMT 2008


Hariharan wrote:

> I am not exactly sure if this is buggy behaviour, but it obviously isnt
> what i would have expected.
> 
> Please clarify if this is a bug.

It's a bug in your expectations.  "#if 0" is not the same as a glorified
comment marker.  The text it contains must still consist of valid
preprocessor tokens, because it must still remain parsable by the
preprocessor.  Consider for example that "#endif" could occur inside a
backslash-newline-continued string and in that case it is a string
literal and not treated as an #endif by the preprocessor.  So, the
preprocessor has to care about balanced quotes, even in text that it is
discarding.

Brian



More information about the Gcc-help mailing list