#if 0
This is a
#if 0
nested comment!
#endif
#endif #if 0
This is a
#if 0
nested comment!
#endif
#endif(unifdef has some evil code to support using C-style preprocessor directives with non-C source, which mostly boils down to ignoring comments. I don’t recommend it!)
Are you sure? I just tried on godbolt and that’s not true with gcc 14.2. I’ve definitely put syntax errors intentionally into #if 0 blocks and had it compile. Are you thinking of some older version or something? I thought the pre-processor ran before the lexer since always…
• program is lexed into preprocessing tokens; comments turn into whitespace
• preprocessor does its thing
• preprocessor tokens are turned into proper tokens; different kinds of number are disambiguated; keywords and identifiers are disambiguated
If you put an unclosed comment inside #if 0 then it won’t work as you might expect.