This is the mail archive of the
mailing list for the GCC project.
Re: Implement -Wswitch-fallthrough
On Tue, Jul 12, 2016 at 04:08:02PM +0200, Marek Polacek wrote:
> 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]*
(those 4 as standardized lint comments only in lowercase, the
above regexps are meant to match the whole comment content, i.e.
everything between /* and */ or // and \n.