On Tue, Sep 27, 2016 at 05:19:10PM +0200, Bernd Schmidt wrote: > On 09/27/2016 05:04 PM, Jakub Jelinek wrote: > >>>On Tue, Sep 27, 2016 at 9:56 AM, Michael Matz <m...@suse.de> wrote: > >>>>All those bugs would also have been found as well when it had simply > >>>>accepted > >>>> /fall.*thr/i > >>>>anywhere in the preceding comment on one line. But all the recent > >>>>spelling changes of comments to cater for the strictness exactly shows how > >>>>misguided that is. The above would accept "Don't fall through" as well. > >>>>I say: so what? > > >Perhaps we want -Wimplicit-fallthrough{,=1,=2,=3,=4}, where > >=1 would match indeed /fall.*thr/i (note, it will be really costly in this > >case, one will have to parse all comments in detail in the preprocessor, > >so I'd be against making it the default), =2 would allow > >what we do right now, perhaps with the optional else and dots (perhaps > >selected other interpunction chars), =3 would only allow the standardized > >lint comments and =4 would not allow any comments, just the attributes? > >Then each project can choose what they want. > > I feel that's overthinking it. I believe Michael has identified the correct > way to think about the issue.
See above, it is very expensive at preprocessing time (look at how the preprocessor optimizes skipping over comments, with that it is all gone), and not everybody will want /* Don't fall through here. */ or /* This is fallible. Threats are high. */ (pick any of the hundreds+ english words with fall in them and thousands+ of words with thr in them) to disable the warning. Jakub