Created attachment 43515 [details] reproducing source code The attached archive contains foo.c (as well as foo.p and foo.i, for reference) that if preprocessed with -fdirectives-only on Windows (for example, using the MinGW build of GCC) produces incorrect result: gcc.exe -E -fdirectives-only -o foo.p foo.c gcc.exe -E -fpreprocessed -fdirectives-only -x c foo.p >foo.i foo.c:7:16: warning: missing terminating " character foo.c:9:30: warning: missing terminating " character It appears that in the first invocation GCC replaces each LF character with the CRLF sequence thus ending up with CRCRLF sequences. Will be happy to test a patch.
Still being bitten by this with GCC 10.2. Any translation unit that uses a line continuation in a string literal triggers this bug. A typical example: char copyright[] = "@(#) Copyright (c) 1990 The Regents of the University of California.\n\ All rights reserved.\n";
Still present in GCC 12.2.0. Just hit it with SQLite 3.39.4 source code (shell.c): shell.exe.o.i:165900:40: error: unterminated string literal