https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84583
Bug ID: 84583 Summary: -fdirectives-only does not handle CRLF properly Product: gcc Version: 7.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: preprocessor Assignee: unassigned at gcc dot gnu.org Reporter: boris at kolpackov dot net Target Milestone: --- Created attachment 43515 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43515&action=edit 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.