主要内容

-misra-c-2025

R2026b

Check 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:

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-required select custom. 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) to C or C-CPP.

    For projects with mixed C and C++ code, the MISRA C:2025 checker analyzes only .c files.

  • If you set Source code language (-lang) to C-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 as MISRA 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 file_name -misra-c-2025 mandatory-required
Example (Bug Finder Server): polyspace-bug-finder-server -lang c -sources file_name -misra-c-202 mandatory-required

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


1  MISRA and MISRA C are registered trademarks of MIRA Ltd., held on behalf of the MISRA Consortium.