smatch unreachable code checking needs reworking
The reasons are lost in the fogs of time (that is, last year), but for some reason, we have an
explicit list of no_return functions in smatch_data/. A quick test seems to indicate that it's at
least partly not necessary, because smatch does understand noreturn attribute.
Furthermore, we have "unreachable" globally disabled right now. I just ran smatch against
usr/src/lib and only got a few complaints. If we can, we should re-enable this check except
where we explicitly need to disable it.
Updated by John Levon over 1 year ago
One annoyance here is that lex itself adds a non-noreturn exit() prototype. So all lex C users may need to disable the unreachable check (along with other checks that would otherwise be silenced).
This still seems preferable to explicitly listing exit() in noreturn, probably. Or if we do we can at least comment as to why.
Updated by Electric Monk 11 months ago
- Status changed from New to Closed
- % Done changed from 0 to 100
commit 44bf619d328827ce5eca6833fcd5c69f1592e578 Author: John Levon <firstname.lastname@example.org> Date: 2019-08-21T07:48:36.000Z 10703 smatch unreachable code checking needs reworking Reviewed by: Toomas Soome <email@example.com> Reviewed by: Yuri Pankov <firstname.lastname@example.org> Approved by: Dan McDonald <email@example.com>