フィルターのクリア

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 Center および File ExchangeMISRA 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