Filter löschen
Filter löschen

MISRA-C-2012

2 Ansichten (letzte 30 Tage)
Luis Blanco Abruña
Luis Blanco Abruña am 24 Jan. 2019
Beantwortet: Kausthub am 16 Mär. 2024
I generate code with Embedded Coder with the objective of MISRA-C-2012 (It is the only 'generation objective' I set in this generation).
It is a complex model that generates more than 30KLOC.
But, when I analyze such code with Polyspace Code Prover I obtain more than 1K rule violations.
Should not be it zero discrepancies?
Is there any other addition configuration in both tools to manage this objective?
Kind regards

Antworten (1)

Kausthub
Kausthub am 16 Mär. 2024
Hi Luis,
Yes, the aim is for zero discrepancies but the code generated by Embedded Coder is not completelty MISRA C:2012 compliant and has a few violations.
But, you could reduce the number of violations by selecting the right properties from the configuration panel of Embedded Coder. For example you can reduce a lot of MISRA C:2012 violations by setting the casting mode from 'Nomial' to 'Standard Compliance', restricting signed left and right shifts, enabling justifications etc.
Here is an article on how you could reduce MISRA C:2012 violations:
Hope it helps!

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by