Implement -Wimplicit-fallthrough (version 9)
Tom Tromey
tom@tromey.com
Tue Sep 27 16:47:00 GMT 2016
>>>>> "Michael" == Michael Matz <matz@suse.de> writes:
Michael> All those bugs would also have been found as well when it had simply
Michael> accepted
Michael> /fall.*thr/i
Michael> anywhere in the preceding comment on one line. But all the recent
Michael> spelling changes of comments to cater for the strictness exactly shows how
Michael> misguided that is. The above would accept "Don't fall through" as well.
Michael> I say: so what?
The point of the warning is to make code more robust. But accepting any
comment like "Don't fall through" is not more robust, but rather an
error waiting to happen; as IIUC the user has no way to detect this
case.
I think it's better for the comment-scanning feature to be very picky
(or even just not exist at all) -- that way you know exactly what you
are getting. Lint was traditionally picky IIRC. And, this is a warning
that isn't default and can also be disabled, so it's not as if users
have no recourse.
Tom
More information about the Gcc-patches
mailing list