On Tue, Sep 08, 2020 at 07:28:45AM -0700, Bruce Korb via Gcc wrote:
> On Tue, Sep 8, 2020 at 2:33 AM Jonathan Wakely <jwakely....@gmail.com> wrote:
> > > Nope. I had /* FALLTHROUGH */ on the line before a blank line before
> > > the case label. After Googling, I found an explicit reference that you
> > > had to spell it: // fall through
> > > I did that, and it worked. So I'm moving on, but still ...
> >
> > The canonical reference is
> > https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wimplicit-fallthrough
> > and it says FALLTHROUGH is fine (except with -Wimplicit-fallthrough=5
> > which "doesn’t recognize any comments as fallthrough comments, only
> > attributes disable the warning").
> 
> Thank you. It turns out it was in someone else's code that I'd
> incorporated into my project.
> The fall through comment was polluted with a colon that I hadn't noticed, as 
> in:
> 
>     /* FALLTHROUGH: */
> 
> and your fall through regex doesn't allow for that.
> I'd add a colon to the space, tab and '!' that the regex accepts.

I think it is a bad idea to change the regexps, it has been done that way
for quite a while and many people could rely on what exactly is and is not
handled.
You can either adjust your code, or switch to using -Wimplicit-fallthrough=2
if the project wants the comments to be even more free form than what the
default handles.  The regexps came from extensive code searches for what is
used in the wild.

There is always the option to use attributes or builtins...

        Jakub

Reply via email to