Re:Disable comments make static analysis tools worse
by bluGill on Tuesday July 06, 2021 @09:27AM
(#27748211)
> all static analysis rules should be followed to the letter.
But all static rules should be carefully reviewed as well. Those who wrote those C rules (probably MIRSA, but there are other sets of rules) have a long list of considerations and whys. Many of the rules of exceptions built in so that they can avoid the problems while allowing the useful case. (Ie no memory allocation EXCEPT at startup)
If it’s an internal CRUD webapp then who cares if a few pedantic lint rules (max length line anyone?) are disabled.
If it’s a safety critical application written in c that controls an airplane avionics then all static analysis rules should be followed to the letter.