MCUXpresso_MIMXRT1052xxxxB/rtos/freertos/corepkcs11/MISRA.md
Yilin Sun c2668b7ca0
Update SDK to v2.13.0
Signed-off-by: Yilin Sun <imi415@imi.moe>
2023-01-26 09:35:56 +08:00

1.7 KiB

MISRA Compliance

The PKCS #11 library files conform to the MISRA C:2012 guidelines, with some noted exceptions. Compliance is checked with Coverity static analysis. The specific deviations, suppressed inline, are listed below.

Additionally, MISRA configuration file contains the project wide deviations.

Suppressed with Coverity Comments

To find the violation references in the source files run grep on the source code with ( Assuming rule 10.5 violation; with justification in point 1 ):

grep 'MISRA Ref 10.5.1' . -rI

Rule 10.5

Ref 10.5.1

  • MISRA C-2012 Rule 10.5 The value of an expression should not be cast to an inappropriate essential type. The boolean type of the PKCS #11 standard is an unsigned char, which is an acceptable base type for a boolean type.

Rule 11.1

Ref 11.1.1

  • MISRA C-2012 Rule 11.1 Doesn't allow conversions between function pointers and any other type However, since we're just using this to supress the compiler warning, we're also fine with supressing the MISRA violation related to this line as well.

Rule 12.1

Ref 12.1.1

  • MISRA C-2012 Rule 12.1 Requires precendence of operators within an expression to be explicit. The third party macro being used here throws a violation when used. Adding additional parens to the call or to the decleration doesn't remove the violation, so we supress it.

Rule 11.5

Ref 11.5.1

  • MISRA C-2012 Rule 11.5 Allow casts from void *. Fields such as publish payloads are passed as void * and must be cast to the correct data type before use.