Main Content

Use generated code requirements (-misra3-agc-mode)

(Removed) Check for violations of MISRA C:2012 rules and directives that apply to generated code

Using Code Prover to check for violations of MISRA C™:2012 rules and directives that apply to generated code is no longer supported. Use Use generated code requirements (-misra3-agc-mode) in Bug Finder instead. For more information, see Version History.

Description

Specify whether to use the MISRA C:2012 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.

Command line and options file: Use the option -misra3-agc-mode. See Command-Line Information.

Why Use This Option

Use this option to specify that you are checking for MISRA C:2012 rules in generated code. The option modifies the MISRA C:2012 subsets so that they are tailored for generated code.

Settings

Off (default)

Use the normal categories (mandatory, required, advisory) for MISRA C:2012 coding guideline checking.

On (default for analyses from Simulink®)

Use the generated code categories (mandatory, required, advisory, readability) for MISRA C:2012 coding guideline checking.

For analyses started from the Simulink plug-in, this option is the default value.

 Category changed to Advisory

 Category changed to Readability

Dependency

To use this option, activate at least one MISRA C:2012 rule. To activate MISRA C:2012 rules, use either of these:

When using an XML file to specify a custom selection, select at least one MISRA C:2012 rule in the file.

Command-Line Information

Parameter: -misra3-agc-mode
Default: Off
Example (Bug Finder): polyspace-bug-finder -sources file_name -misra3 all -misra3-agc-mode
Example (Code Prover): polyspace-code-prover -sources file_name -misra3 all -misra3-agc-mode
Example (Bug Finder Server): polyspace-bug-finder-server -sources file_name -misra3 all -misra3-agc-mode
Example (Code Prover Server): polyspace-code-prover-server -sources file_name -misra3 all -misra3-agc-mode

Version History

expand all

R2024a: Removed from Code Prover

If you use the option -misra3-agc-mode in a Code Prover analysis, Polyspace® issues a warning and ignores the option. The workflow for checking coding rule violation has been removed from Code Prover. To check for coding rule violations, use Bug Finder. For instance, at the command line, replace this command:

polyspace-code-prover -sources file_name -misra3 all -misra3-agc-mode
with this command:
polyspace-bug-finder -sources file_name -misra3 all -misra3-agc-mode
See Migrate Code Prover Workflows for Checking Coding Standards and Code Metrics to Bug Finder.