Q: I thought that an #if 0 block will ignore everything inside it. But it doesn't.
A: The ANSI standard says that #if statements only ignore syntactically correct code. So if there are syntax errors, you get an error. Two particularly nasty ones are unterminated comments, and unterminated string constants. See examples below.
/tmp/foo.c contains:
#ifdef NEVER
/* this is the start of
a comment that never ends
#endif
/lib/cpp /tmp/foo.c generates:
/tmp/foo.c:1: unterminated '#if' conditional
Or, /tmp/foo.c contains:
#ifdef NEVER
some words with a single quote ' OK
#endif
it generates:
/tmp/foo.c:2: unterminated string constant
/tmp/foo.c:1: unterminated #if conditional
Note: In 3.0 or 3.1, the error generated reads:
/tmp/foo.c:2: unterminated character constant
QA454
Valid for 1.0, 2.0, 3.0