Use generated code requirements for MISRA standards
(-misra-agc-mode)
R2026bCheck for violations of MISRA C rules and directives that apply to generated code
Since R2026b
Description
Specify whether to use the categorization of MISRA C™ standard that apply to automatically generated code. This option changes
which rules are mandatory, required, or advisory. In MISRA C:2025, some rules are
categorized as Disapplied when this option is specified.
Set Option
Set the option using one of these methods:
Polyspace Platform user interface (desktop products only): In your project configuration, on the Static Analysis tab, select Defects and Coding Standards and then select this option. See Dependencies for other options you must enable first.
Command line and options file: Use the option
-misra-agc-mode. See Command-Line Information.Python® API: Set the
MisraAgcModeproperty in the static analysis configuration. Seepolyspace.project.StaticAnalysisConfiguration(Polyspace Test).TOML configuration file (
.toml.pscfg) — Use the keyMisraAgcModein the[BugFinderAnalysis]table. For example:[BugFinderAnalysis] MisraAgcMode = true
Why Use This Option
Use this option to specify that you are checking for violations of MISRA C standards in generated code. The option modifies the MISRA C subsets so that they are tailored for generated code.
The option does not add or remove rules from the MISRA C rules specified using their corresponding options such as Check MISRA C:2023
(-misra-c-2023) or -misra-c-2025. Instead, it changes the categorization of the rules.
Settings
-
Off (default) Use the normal categories (mandatory, required, advisory) for MISRA C coding guideline checking.
-
On (default for analyses from Simulink®) Use the generated code categories for MISRA C coding guideline checking.
For analyses started from the Polyspace® Verifier app in Simulink, this settings is the default value.
Dependencies
In the Polyspace Platform user interface, this option is shown only when you select
Use custom checkers file.
At the command line, this options is applied only if at least one MISRA C coding rule is activated. To activate MISRA C coding rules in the command line:
Use individual options for MISRA C standards — Activate a preselected subset of the MISRA C standards by using options such as
-misra-c-2025,Check MISRA C:2023 (-misra-c-2023), or-misra3.Use activation file — Activate a custom selection of checkers including at least one MISRA C rule by using the option
Checkers activation file (-checkers-activation-file).
Command-Line Information
Use the command -misra-agc-mode in the command line to check for
violations of MISRA C rules and directives that apply to generated code.
Parameter:
-misra-agc-mode
|
| Default: Off |
Example (Bug Finder):
polyspace-bug-finder -sources
|
Example (Bug Finder Server):
polyspace-bug-finder-server -sources
|
Version History
Introduced in R2026b