cmisra

MISRA C mapping to Klocwork violations


Is there a mapping between MISRA rules for example:

into a Klocwork checker?

for example I was able to find: requierment: The operand of the sizeof operator shall not contain any expression that has potential side effects (MISRA C R.13.6).

klocwork: MISRA.SIZEOF.SIDE_EFFECT Operand of sizeof has side effects 5-3-4 Pre-2020.1

how do you handle these for MISRA C?


Solution

  • Typically, tool vendors have a many-to-many mapping between their own in-house mappings, and third-party rule-sets such as MISRA C or CERT C.

    Klocwork themselves provide the mappings in their product documentation:.

    https://help.klocwork.com/current/en-us/concepts/misrac2012_amd1nolinks.htm

    Note: Answer expanded by Andrew, to address review comment (which can, hopefully, now be deleted)