This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug regression/78497] New: compiling with -save-temps adds -Wimplicit-fallthrough warnings
- From: "aoliva at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 23 Nov 2016 18:20:43 +0000
- Subject: [Bug regression/78497] New: compiling with -save-temps adds -Wimplicit-fallthrough warnings
- Auto-submitted: auto-generated
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.