On Fri, Sep 30, 2016 at 11:31:43AM +0200, Jakub Jelinek wrote: > On Fri, Sep 30, 2016 at 11:26:27AM +0200, Marek Polacek wrote: > > On Thu, Sep 29, 2016 at 10:16:33PM +0200, Jakub Jelinek wrote: > > > The following patch does a few things: > > > 1) fixes -Wimplicit-fallthrough -C > > > (with -C the PREV_FALLTHROUGH flag is on the CPP_COMMENT token, we need > > > to propagate it to the C/C++ token's flags in the FEs) > > > 2) it accepts a comment in between /* FALLTHRU */ comment and the > > > case/default keyword or user label, people often write: > > > ... > > > /* FALLTHRU */ > > > > > > /* Rationale or description of what the following code does. */ > > > case ...: > > > and forcing users to move their comments after the labels or after the > > > first label might be too annoying > > > 3) it adds support for some common FALLTHRU comment styles that appeared > > > in GCC sources, or in Linux kernel etc., e.g.: > > > > > > /*lint -fallthrough */ > > > > > > /* ... falls through ... */ > > > > > > /* else fall-through */ > > > > > > /* Intentional fall through. */ > > > > > > /* FALLTHRU - some explanation why. */ > > > > I haven't gone over the patch in detail yet, but I wonder if we should > > also accept /* Else, fall through. */ (to be found e.g. in > > aarch64-simd.md). > > Clearly people are extremely creative with these comments, maybe it would be > better to just remove the new additions from the patch I've posted (drop the > else/intentational/intentationally/... around/!!! around etc., to force > people to standardize on something), and just apply the fixes and support > for comments in between.
Obviously you can get a very wide range of opinions here. I like the patch; while I don't think we should allow complete free form, accepting stuff like /* ... falls through ... */ or /* else fall-through */ is a good thing. Marek