On Fri, Sep 30, 2016 at 10:10:55AM -0600, Martin Sebor wrote:
> I haven't been following the discussion very closely so I may have
> missed that what I'm about to suggest has been discussed and rejected
> for some valid reason, but if not let me try.
> 
> It seems to me that the ultimate, long term goal should be to have
> actively maintained code bases gradually migrate away from the
> various fallthrough comments and to the new attribute.  Under that
> premise, I think introducing a warning that's on the permissive end
> of the spectrum (say outside of -Wall, or even outside of -Wextra,
> and/or disabling the checker at the first sight of a comment) would
> obviate the concern of needlessly breaking working code and let
> users start adopting the warning on their own schedules.  The next
> major release of GCC after 7 could increase the sensitivity of the
> warning (e.g., by adding it -Wextra, and/or checking for the words
> fall though in the comments, etc.), and the next one could make it
> even more strict.  With GCC's one year release cycle this approach
> would give even users who adopt the latest compiler two to three
> years to make the transition.

That is IMHO a bad idea, because almost nobody will really use it and the
warning option will bitrot.  The reason why we've added parsing of the most
common comments was exactly to be able to enable it already in -Wextra.
clang has it outside of -Wextra and (almost) nobody really started adopting
the attributes.

The option to have different levels of -Wimplicit-fallthrough= has been
proposed, that would allow projects to choose if they only allow attributes
to disable the warning, or also some very strict set of comments, or more
relaxed set of comments, or perhaps any comment before the label.

        Jakub

Reply via email to