Effacer les filtres
Effacer les filtres

MISRA-C-2012

2 vues (au cours des 30 derniers jours)
Luis Blanco Abruña
Luis Blanco Abruña le 24 Jan 2019
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

Réponses (1)

Kausthub
Kausthub le 16 Mar 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!

Catégories

En savoir plus sur MISRA C:2012 Compliance Considerations dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by