[PATCH] Fix -Wimplicit-fallthrough -C, handle some more comment styles and comments in between FALLTHRU comment and label

Michael Matz matz@suse.de
Tue Oct 4 15:58:00 GMT 2016


Hi,

On Sat, 1 Oct 2016, Jakub Jelinek wrote:

> > -      /* ... fall through for unsigned ints ...  */
> > +      /* fall through */
> > 
> > -                /* For other instructions, fallthru.  */
> > +                /* fallthru.  */
> > 
> > -      /* fall thru to manual case */
> > +      /* fall thru */
> > 
> > 
> > So, because of its excessive pickiness, the warning ends up making the user 
> > butcher informative comments.  How is that helpful?
> 
> Note, the wast majority of the fallthru comments are already recognized, it
> is only when people start to write those in free form.

Which is what happens often.  How can you not see that with patches 
transforming from free form to strict form fly by _on this very mailing 
list_ ?

> E.g. today I wanted to try Marek's testcase from some PR and have commented
> out [[fallthrough]]; attribute - // [[fallthrough]];
> if we are not picky enough, it will be handled as a valid fallthrough
> comment, which might not be the intent.

That quickly gets into absurd arguments for strictness.


Ciao,
Michael.



More information about the Gcc-patches mailing list