On Mon, 7 Sep 2020 at 23:53, Bruce Korb via Gcc <gcc@gcc.gnu.org> wrote:
>
> On Mon, Sep 7, 2020 at 3:45 PM Florian Weimer <f...@deneb.enyo.de> wrote:
> >
> > * Bruce Korb via Gcc:
> >
> > > I don't write a lot of code anymore, but this sure seems like a
> > > gratuitous irritation to me. I've been using
> > >
> > >     // FALLTHRU and
> > >     // FALLTHROUGH
> > >
> > > for *DECADES*, so it's pretty incomprehensible why the compiler should
> > > have to invalidate my code because it thinks a different coding
> > > comment is better.
> >
> > It's not clear what you are talking about.
> >
> > Presumably you placed the comment before a closing brace, and not
> > immediately before the subsequent case label?
>
> 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").

Reply via email to