필터 지우기
필터 지우기

MISRA-C-2012

조회 수: 2 (최근 30일)
Luis Blanco Abruña
Luis Blanco Abruña 2019년 1월 24일
답변: Kausthub 2024년 3월 16일
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

답변 (1개)

Kausthub
Kausthub 2024년 3월 16일
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!

카테고리

Help CenterFile Exchange에서 MISRA C:2012 Compliance Considerations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by