-misra-c-2025
R2026bCheck for violations of MISRA C:2025 rules and directives
Since R2026b
Description
Specify whether to check for violations of MISRA C™:2025 rules and directives1 Each value of the option corresponds to a subset of guidelines to check.
Set Option
Set the option using one of these methods:
Polyspace Platform user interface (desktop products only): This option does not exist in the project configuration. Activate checkers by using the options
Use custom checkers fileandCheckers activation file (-checkers-activation-file).Command line and options file: Use the option
-misra-c-2025. See Command-Line Information.
Why Use This Option
Use this option to specify the subset of MISRA C:2025 rules to check.
After analysis, the Results List pane lists the coding standard violations. On the Source pane, for every coding rule violation, Polyspace® assigns a
symbol to the keyword or identifier relevant to the violation.
Settings
Default:
mandatory-required
-
mandatory Check for mandatory guidelines.
-
mandatory-required Check for mandatory and required guidelines.
Mandatory guidelines: Your code must comply with these guidelines.
Required guidelines: You may deviate from these guidelines. However, you must complete a formal deviation record, and your deviation must be authorized. See Chapter 4 of the document MISRA™ Compliance:2020. For an example of a deviation record, see Appendix B of the document.
Note
To turn off some required guidelines, instead of
mandatory-requiredselectcustom. To clear specific guidelines, click
. In the Comment column,
enter your rationale for disabling a guideline. For instance, you can enter the
Deviation ID that refers to a deviation record for the guideline. The rationale
appears in your generated report.-
all Check for mandatory, required, and advisory guidelines.
-
all-rules Check for all rules, ignoring all directives.
Dependencies
This option is available only if you set
Source code language (-lang)toCorC-CPP.For projects with mixed C and C++ code, the MISRA C:2025 checker analyzes only
.cfiles.If you set
Source code language (-lang)toC-CPP, you can activate a C coding rule checker and a C++ coding rule checker. When you have both C and C++ coding rule checkers active, to avoid duplicate results, Polyspace does not produce the C coding rules found in the linking phase (such asMISRA C:2023 Rule 8.3).
Command-Line Information
Use the command -misra-c-2025 in the command line to check for violations of MISRA C:2025 rules and guidelines.
Parameter:
-misra-c-2025
|
Value:
mandatory | mandatory-required | all | all-rules
|
Example (Bug Finder):
polyspace-bug-finder -lang c -sources
|
Example (Bug Finder Server):
polyspace-bug-finder-server -lang c -sources
|
Alternatively, enable all or specific MISRA C:2025 rules through a checkers activation XML file. See Checkers activation file (-checkers-activation-file).
Version History
Introduced in R2026b
See Also
Do not generate results for (-do-not-generate-results-for) | Use generated code requirements for MISRA standards (-misra-agc-mode)
1 MISRA and MISRA C are registered trademarks of MIRA Ltd., held on behalf of the MISRA Consortium.