3 ms·
Every place that I’ve worked chooses a subset of MISRA rules to follow and ignores the rest. A rationale for the ignored rules is written in a document somewher
by cbsks 3y ago
Every place that I’ve worked chooses a subset of MISRA rules to follow and ignores the rest. A rationale for the ignored rules is written in a document somewhere which can be provided to safety auditors.
A deviation for a rule in the “required” set can be made for specific cases.
The “no commented-out fragments of code” is a weird one. It was not required at my previous employer, but it is at my current. It means that you can’t have comments like this without a deviation:
// This function is only called from
// main()
Which is much more readable to me than:
// This function is only called from
// main
I see what they are trying to prevent, which is people commenting out code instead of removing it. In my experience, code that is commented out usually means that it was committed accidentally, or the author didn’t really understand what the old code was doing so they didn’t delete it entirely.