GCC is correct.
Comments are replaced (including line breaks) in phase 3 of the translation, preprocessing in phase 4 of the translation (ISO / IEC 9899: 1999, Β§5.1.1.2).
Therefore, the compiler preprocessing part no longer βseesβ line breaks.
And, #error is defined as follows (Β§6.10.5):
Form preprocessing directive
# error pp-tokens_opt new-line
leads to the fact that the implementation creates a diagnostic message that contains the specified sequence of pre-processing tokens.
So foo should be part of the output.
undur_gongor
source share