This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Implement -Wswitch-fallthrough


On Tue, Jul 12, 2016 at 10:10:23AM -0600, Jeff Law wrote:
> On 07/11/2016 01:43 PM, Marek Polacek wrote:
> > The switch fallthrough has been widely considered a design defect in C, a
> > misfeature or, to use Marshall Cline's definition, evil.  The overwhelming
> > majority of the time you don't want to fall through to the next case, but it is
> > easy to forget to "break" at the end of the case, making this far too error
> > prone.  Yet GCC (and probably other compilers, too) doesn't have the ability to
> > warn in this case.  A feature request for such warning was opened back in 2002,
> > but it's mostly been untouched since.  But then the [[fallthrough]] attribute was
> > approved for C++17 [1], and that's what has got me to do all this.
> [ ... ]
> This is going to be rather contentious.  So as we're hashing through that,
> can you split off the patches which fix bugs rather than those which add
> fallthru annotations?

To (belatedly) answer this, I posted
<https://gcc.gnu.org/ml/gcc-patches/2016-07/msg01880.html> to address this.

	Marek


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]