https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78497
Bug ID: 78497 Summary: compiling with -save-temps adds -Wimplicit-fallthrough warnings Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: regression Assignee: unassigned at gcc dot gnu.org Reporter: aoliva at gcc dot gnu.org Target Milestone: --- Since -save-temps performs separate preprocessing and drops comments, and -Wimplicit-fallthrough machinery recognizes some of the fallthrough comments to silence warnings, we get additional warnings (or errors, with -Werror) when compiling with -save-temps vs without it. It occurred to me that the preprocessor must be looking out for such comments in order for -Wimplicit-fallthrough to work, and in case of separate preprocessing, it would be desirable to retain information about the internal state implied by the removed comments in a #line directive, so that even with separate preprocessing we'd still have the same state to work with during compilation. This may require introducing artificial line breaks and blanks in the preprocessed output, so as to introduce the state at the right point in the (to be reconstructed) token stream.