This is a testcase (a space before a backslash or after a newline, and two pairs of quotes (or no quotes at all), are important): "hello," \ "world" In GCC 4.5.0 20091015, preprocessor produces this: # 1 "<stdin>" # 1 "<built-in>" # 1 "<command-line>" # 1 "<stdin>" "hello," "world" whereas older GCC versions give this: # 1 "<stdin>" # 1 "<built-in>" # 1 "<command-line>" # 1 "<stdin>" "hello," "world" Such a new behavior seems to be in contradiction with what the documentation says: "the backslash is removed and the following line is joined with the current one."
The lines are joined into a logical line, that's what the C standard requires. But where do you see requirement that everything on one logical line has to appear on the line in preprocessed output? The reason it is emitted on the next line is to give the second string literal token proper location. The tokens are separate and a compiler compiles both "foo" "bar" and "foo" "bar" the same (as it doesn't record the line numbers for the string literals at all). See PR41445 for why this change has been made. If you care about this because you use the preprocessed output for something else, consider using -P option. That says you don't care about token locations.
Ok, thanks for the clarification. I believe this should be documented.
Documented on 'Frequently Asked Questions' wiki page: <http://gcc.gnu.org/wiki/FAQ#cpp_continuation_discarded>.