Why MISRA-C:2012 rules 8.1 and 17.3 seem to be disabled even when selected in Polyspace?

23 views (last 30 days)
I enabled rules MISRA-C:2012 rules 8.1 and 17.3 in my Polyspace project configuration. However, in the Polyspace results, these rules are not activated. For example, when generating a report, these rules are disabled. 
Guideline Description Mode Enabled
8.1 Types shall be explicitly specified. required FALSE
17.3 A function shall not be declared implicitly. mandatory FALSE

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 15 Nov 2023
Edited: MathWorks Support Team on 15 Nov 2023
These two MISRA rules are dedicated to ANSI C90 Standard only.
By default, when you launch Polyspace, the project is using the ANSI C99 Standard compliant, and not C90. As a result, these two rules get disabled during analysis.
In Polyspace R2018a and earlier,
 you can enable them by selecting "Respect C90 Standard" under "Target & Compiler" section of the project configuration.
In command line, the option is: -no-language-extensions
In Polyspace R2018b and newer
, you can enable the C90 standard by switching the "C Standard Version" under the "Target & Compiler" section to C90.
In command line, the option is: -c-version C90
NOTE: This may have some side-effects because the code will be required to be C90 standard compliant.
Below are the documentation references for the rules 8.1 and 17.3:

More Answers (0)

Tags

No tags entered yet.

Products


Release

No release entered yet.

Community Treasure Hunt

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

Start Hunting!