Hello,
Which error ids correspond respectively to MISRA C:2012 rules 1.3, 2.1, 2.2, 2.4, 2.6, 8.3, 13.2, 14.3, 17.5, 18.1, 18.2, 18.3, 18.6, 20.6, 22.1, 22.2, 22.4, 22.6?
I'm adopting a subset of MISRA C:2012 so I need to know which error ids I should suppress.
Thanks in advance.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I suppose some of these rules couldn't be completely disabled anyway, since they assume the presence of rough errors in the sources. See, for example, definition of rule 1.3.
Are you sure that you want to disable these checks?
Anyway, for some rules we can get ids of corresponding errors using cppcheck --enable=all on sources with MISRA violations. I got the following list, when checking this MISRA Example-Suite sources:
2.1 – unreachableCode
2.2 – unreadVariable, clarifyStatement, unusedFunction
2.4 – unusedFunction
2.6 – unusedLabel
8.3 – funcArgOrderDifferent
13.2 – unknownEvaluationOrder
14.3 – knownConditionTrueFalse, unsignedLessThanZero, inCorrectLogicOperator
18.1 – arrayIndexOutOfBounds, negativeIndex, unreadVariable, ctuArrayIndex
18.2 – comparePointers, unassignedVariable
18.3 – comparePointer
18.6 – returnDanglingLifetime
20.6 – preprocessorErrorDirective
22.1 – resourceLeak
22.2 – constArgument, dobuleFree, autovarInvalidDeallocation
22.4 – writeReadOnlyFile
22.6 – useClosedFile
Hope this helps.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you Georgy, the MISRA Example-Suite was a great starting point.
To be clear: I don't want to disable these checks. It's the other way round: I want to keep only these checks and disable the others that Cppcheck does.
It would be nice to have an exact corrispondence between checks and rules as in the misra.py addon
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
Which error ids correspond respectively to MISRA C:2012 rules 1.3, 2.1, 2.2, 2.4, 2.6, 8.3, 13.2, 14.3, 17.5, 18.1, 18.2, 18.3, 18.6, 20.6, 22.1, 22.2, 22.4, 22.6?
I'm adopting a subset of MISRA C:2012 so I need to know which error ids I should suppress.
Thanks in advance.
Hello,
I suppose some of these rules couldn't be completely disabled anyway, since they assume the presence of rough errors in the sources. See, for example, definition of rule 1.3.
Are you sure that you want to disable these checks?
Anyway, for some rules we can get ids of corresponding errors using
cppcheck --enable=all
on sources with MISRA violations. I got the following list, when checking this MISRA Example-Suite sources:2.1 – unreachableCode
2.2 – unreadVariable, clarifyStatement, unusedFunction
2.4 – unusedFunction
2.6 – unusedLabel
8.3 – funcArgOrderDifferent
13.2 – unknownEvaluationOrder
14.3 – knownConditionTrueFalse, unsignedLessThanZero, inCorrectLogicOperator
18.1 – arrayIndexOutOfBounds, negativeIndex, unreadVariable, ctuArrayIndex
18.2 – comparePointers, unassignedVariable
18.3 – comparePointer
18.6 – returnDanglingLifetime
20.6 – preprocessorErrorDirective
22.1 – resourceLeak
22.2 – constArgument, dobuleFree, autovarInvalidDeallocation
22.4 – writeReadOnlyFile
22.6 – useClosedFile
Hope this helps.
Thank you Georgy, the MISRA Example-Suite was a great starting point.
To be clear: I don't want to disable these checks. It's the other way round: I want to keep only these checks and disable the others that Cppcheck does.
It would be nice to have an exact corrispondence between checks and rules as in the misra.py addon