Use generated code requirements
(-misra-c-2023-agc-mode
)
Check for violations of MISRA C:2023 rules and directives that apply to generated code
Since R2024a
Description
Specify whether to use the MISRA C™:2023 categories for automatically generated code. This option changes which rules are mandatory, required, or advisory.
Set Option
User interface (desktop products only): In your project configuration, the option is on the Coding Standards & Code Metrics node. See Dependency for other options that you must also enable.
User interface (Polyspace Platform, desktop products only): In your project configuration, in the Static Analysis tab, click Defects and Coding Standards and then select Use generated code requirements for MISRA C:2023.
Command line and options
file
: Use the option -misra-c-2023-agc-mode
. See Command-Line Information.
Why Use This Option
Use this option to specify that you are checking for MISRA C:2023 rules in generated code. The option modifies the MISRA C:2023 subsets so that they are tailored for generated code.
Settings
- Off (default)
Use the normal categories (mandatory, required, advisory) for MISRA C:2023 coding guideline checking.
- On (default for analyses from Simulink®)
Use the generated code categories (mandatory, required, advisory, readability) for MISRA C:2023 coding guideline checking.
For analyses started from the Polyspace® Verifier app in Simulink, this option is the default value.
Dependency
To use this option, activate at least one MISRA C:2023 rule. To activate MISRA C:2023 rules, use either of these:
Use the option
Check MISRA C:2023 (-misra-c-2023)
to activate a preselected subset of the rules.Use the option
Set checkers by file (-checkers-selection-file)
alongsideCheck MISRA C:2023 (-misra-c-2023)
to activate a custom selection that is specified in an XML file.
When using an XML file to specify a custom selection, select at least one MISRA C:2023 rule in the file.
Command-Line Information
Use the command -misra-c-2023-agc-mode
in the command line to check
for violations of MISRA C:2023 rules and directives that apply to generated code.
Parameter:
-misra-c-2023-agc-mode
|
Default: Off |
Example (Bug Finder):
polyspace-bug-finder -sources
|
Example (Bug Finder Server):
polyspace-bug-finder-server -sources
|
Alternatively, activate the rules and directives in an activation XML file. See
Checkers activation file
(-checkers-activation-file)
.
Version History
Introduced in R2024a