Main Content

Check MISRA AC AGC (-misra-ac-agc)

(Removed) Check for violation of MISRA AC AGC rules

Using Code Prover to check for violation of MISRA AC AGC rules is no longer supported. Use Check MISRA AC AGC (-misra-ac-agc) in Bug Finder instead. For more information, see Version History.

Description

Specify whether to check for violation of rules specified by MISRA AC AGC Guidelines for the Application of MISRA-C:2004 in the Context of Automatic Code Generation. Each value of the option corresponds to a subset of rules to check.

Set Option

User interface (desktop products only): In your project configuration, the option is on the Coding Standards & Code Metrics node. See Dependencies for other options that you must also enable.

Command line and options file: Use the option -misra-ac-agc. See Command-Line Information.

Why Use This Option

Use this option to specify the subset of MISRA C™:2004 AC AGC rules to check for.

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: OBL-rules

OBL-rules

Check required coding rules.

OBL-REC-rules

Check required and recommended rules.

single-unit-rules

Check a subset of rules that apply only to single translation units. These rules are checked in the compilation phase of the analysis.

system-decidable-rules

Check rules in the single-unit-rules subset and some rules that apply to the collective set of program files. The additional rules are the less complex rules that apply at the integration level. These rules can be checked only at the integration level because the rules involve more than one translation unit. These rules are checked in the compilation and linking phases of the analysis.

all-rules

Check required, recommended and readability-related rules.

SQO-subset1

Check a subset of rules. In Polyspace Code Prover™, observing these rules can reduce the number of unproven results. For more information, see Software Quality Objective Subsets (AC AGC).

SQO-subset2

Check a subset of rules including SQO-subset1 and some additional rules. In Polyspace Code Prover, observing these rules can further reduce the number of unproven results. For more information, see Software Quality Objective Subsets (AC AGC).

from-file

Specify an XML file where you configure a custom selection of checkers for this coding standard. To create a configuration file, click , then select the rules and recommendations you want to check for this coding standard from the right pane of the Checkers selection window. Save the file.

To use or update an existing configuration file, in the Checkers selection window, enter the full path to the file in the field provided or click Browse.

If you set the option to from-file, enable Set checkers by file (-checkers-selection-file).

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 AC AGC 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:2012 Rule 8.3).

Tips

  • To reduce unproven results in Polyspace Code Prover:

    1. Find coding rule violations in SQO-subset1. Fix your code to address the violations and rerun verification.

    2. Find coding rule violations in SQO-subset2. Fix your code to address the violations and rerun verification.

  • If you select the option single-unit-rules or system-decidable-rules and choose to detect coding rule violations only, the analysis can complete quicker than checking other rules. For more information, see Coding Rule Subsets Checked Early in Analysis.

Command-Line Information

Parameter: -misra-ac-agc
Value: OBL-rules | OBL-REC-rules | single-unit-rules | system-decidable-rules | all-rules | SQO-subset1 | SQO-subset2 | from-file
Example (Bug Finder): polyspace-bug-finder -sources file_name -misra-ac-agc all-rules
Example (Code Prover): polyspace-code-prover -sources file_name -misra-ac-agc all-rules
Example (Bug Finder Server): polyspace-bug-finder-server -sources file_name -misra-ac-agc all-rules
Example (Code Prover Server): polyspace-code-prover-server -sources file_name -misra-ac-agc all-rules

Version History

expand all

R2024a: Removed from Code Prover

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

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