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 09:57:01AM -0400, NightStrike wrote:
> From http://security.coverity.com/blog/2013/Sep/gimme-a-break.html:
 
Thanks, this is useful.

> We also suppress a case label if there is a comment that matches
> [^#]fall.?thro?u, even if it's not on the last line.

Our current plan is to handle sth like
[ \t]*FALL(S | |-)?THR(OUGH|U)\.?[ \t]*
[ \t]*Fall(s | |-)?[Tt]hr(ough|u)\.?[ \t]*
[ \t]*fall(s | |-)?thr(ough|u)\.?[ \t]*

> Maybe that's enough?

We'll see ;).

> The page has other exclusions that might be desirable.

Yea, I wonder how do they recognize Duff's device, in particular.
But I think it shouldn't be a big deal if we warn on them.

	Marek


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