int main(void) { #if 0 something" #endif return 0; }
The simple program above generates a warning: missing terminating " character in gcc. This seems strange because it means that the compiler allows code blocks between #if 0 and endif have an invalid statement, such as something , but not double quotes " that do not match. The same thing happens when using #ifdef and #ifndef .
These comments are in order:
int main(void) { return 0; }
Why? And the single quote ' behaves the same way, are there any other tokens that are specially processed?
Yu Hao
source share