Borrar filtros
Borrar filtros

MISRA-C-2012

2 visualizaciones (últimos 30 días)
Luis Blanco Abruña
Luis Blanco Abruña el 24 de En. de 2019
Respondida: Kausthub el 16 de Mzo. de 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

Respuestas (1)

Kausthub
Kausthub el 16 de Mzo. de 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!

Categorías

Más información sobre MISRA C:2012 Compliance Considerations en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by