[RFA,0/9] Enable -Wimplicit-fallthrough

Message ID 20180421183056.29292-1-tom@tromey.com
Headers show
Series
  • Enable -Wimplicit-fallthrough
Related show

Message

Tom Tromey April 21, 2018, 6:30 p.m.
This series enables -Wimplicit-fallthrough for gdb.  I think this is
valuable because it can prevent the occasional bug.

A couple of the patches are straightforward.  For example, patch #1
changes existing "fall-through" comments to the correct form that will
be recognized by GCC.

In some cases I was not sure which change to make.  I've split all
these out in this series for easier review.  Please examine them
carefully.  This applies to patches 4, 5, 6, and 8.

I chose to use comments rather than the new fall-through attribute
because the comments are more portable: they can be ignored by
compilers that do not understand them, and they do not require
additional configury.

Tested by the buildbot.

Tom

Comments

Pedro Alves May 4, 2018, 5:51 p.m. | #1
On 04/21/2018 07:30 PM, Tom Tromey wrote:
> This series enables -Wimplicit-fallthrough for gdb.  I think this is

> valuable because it can prevent the occasional bug.


Agreed.

> 

> A couple of the patches are straightforward.  For example, patch #1

> changes existing "fall-through" comments to the correct form that will

> be recognized by GCC.

> 

> In some cases I was not sure which change to make.  I've split all

> these out in this series for easier review.  Please examine them

> carefully.  This applies to patches 4, 5, 6, and 8.

> 

> I chose to use comments rather than the new fall-through attribute

> because the comments are more portable: they can be ignored by

> compilers that do not understand them, and they do not require

> additional configury.


Yeah.  Maybe we'll be able to use [[fallthough]] at some point.

I sent a comment to patch 9/9.

Please update the commit log of patch 5/9 reflecting John's
finding, if it makes sense.

Otherwise looks good to me.  Please push.  You'll need to 
regenerate the configure scripts.

Thanks,
Pedro Alves