int main(void)
{
#if 0
something"
#endif
return 0;
}
A simple program above generates a warning: missing terminating " character
in gcc. This seems odd, because it means that the compiler allow the code blocks between #if 0
and endif
have invalid statement like something
here, but not double quotes "
that don't pair. The same happens in the use of #ifdef
and #ifndef
.
Real comments are fine here:
int main(void)
{
/*
something"
*/
return 0;
}
Why? And the single quote '
behave similarly, is there any other tokens that are treating specially?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…