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.
Bernd