Find message inhibitions inside files that have no effect
Sometimes the following happens:
Code is created with a deliberate violation of a lint message.
The message in inhibited with a comment in the code.
However, it often happens comments are not updated with code.
So the reason for the inhibition may be removed and the inhibition stays.
It would be nice to find such "broken" inhibitions, (that have no effect on the resulting messages even when all other inhibitions are disabled).
Maybe this search can be a result of executing pc-lint with a special flag.
This way the code can be cleaned of old inhibitions.
-
Matt commented
There actually are three kind of "broken" inhibitions:
a) Those no longer supported by a new version. Lint should warn about them.
b) Those that no longer apply because the code got refined or lint got relaxed. These would be nice to be reported. But:
c) Those that don't apply to a given project configuration but apply to another! Could lint possibly distinguish these from b)? Wouldn't lint need some kind of multi-configuration option where all potential project configurations with all their settings (symbols, include paths, exclusions,...) are linted at once to achieve this? Maybe we have to accept this hardly is possible. Or just possible for projects with a single configuration. And finally keep 3rd party headers in mind, they have to suppress any issues, as they don't know the lint project options of its customer projects.
-
Matt commented
I prefer having suppressions inside source code, at the very location where a potential issue originates. Things that belong together shouldn't be torn apart.
-
Arpad Toth commented
Or better, provide an external tool that tracks suppressions outside source code.