Check MISRA AC AGC (-misra-ac-agc)
(To be removed) Check for violation of MISRA AC AGC rules
Checking for violations of MISRA™ AC AGC will be removed in a future release. Use the option Use generated
code requirements (-misra-c-2023-agc-mode) with the MISRA C:2023 standard instead (since R2024b). For 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.
To check for MISRA C™:2012 rules that apply to generated code, use the option Use
generated code requirements (-misra3-agc-mode).
Set Option
Set the option using one of these methods:
Polyspace® user interface (desktop products only): In your project configuration, select the Coding Standards & Code Metrics node and then select a value for this option. See Dependencies for other options you must enable first.
Polyspace Platform user interface (desktop products only): This option does not exist in the project configuration. Activate checkers by using the options
Use custom checkers fileandCheckers activation file (-checkers-activation-file).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-rulesCheck required coding rules.
OBL-REC-rulesCheck required and recommended rules.
single-unit-rulesCheck a subset of rules that apply only to single translation units. These rules are checked in the compilation phase of the analysis.
system-decidable-rulesCheck rules in the
single-unit-rulessubset 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-rulesCheck required, recommended and readability-related rules.
SQO-subset1Check a subset of rules.
SQO-subset2Check a subset of rules including
SQO-subset1and some additional rules.from-fileSpecify 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, enableSet checkers by file (-checkers-selection-file).
Dependencies
This option is available only if you set
Source code language (-lang)toCorC-CPP.For projects with mixed C and C++ code, the MISRA AC AGC checker analyzes only
.cfiles.If you set
Source code language (-lang)toC-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
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
Use the command -misra-ac-agc in the command line to check for
violations of MISRA AC AGC rules.
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 |
Example (Bug Finder Server):
polyspace-bug-finder-server -sources |
Alternatively, activate the rules in an activation XML file. See Checkers activation file
(-checkers-activation-file).
