Check SEI CERT-C (-cert-c
)
Check for violations of CERT C rules and recommendations
Description
This option affects Bug Finder only.
Specify whether to check for violations of CERT® C rules and recommendations. Each value of the option corresponds to a subset of the coding standard 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.
User interface
(Polyspace Platform, desktop products only):
This option does not exist in the project configuration. Activate checkers by using
the options Use custom
checkers file
and Checkers
activation file (-checkers-activation-file)
.
Command line and options file: Use the option -cert-c
.
See Command-Line Information.
Why Use This Option
Use this option to specify the subset of CERT C rules and recommendations to check in your code.
After analysis, the Results List pane lists the coding standard violations. On the Source pane, for every coding standard violation, Polyspace® assigns a symbol to the keyword or identifier relevant to the violation.
Settings
Default:
all
all-rules
Check for violations of CERT C rules only.
See the CERT C website for an explanation of the difference between rules and recommendations.
List of CERT-C rules that Polyspace checks when you use
all-rules
publish-2016
Check for violations of CERT C rules only, as defined in the 2016 edition of the SEI CERT C Coding Standard.
See the CERT C website for an explanation of the difference between rules and recommendations.
List of CERT-C rules that Polyspace checks when you use
publish-2016
all
Check for violations of all CERT C rules and recommendations supported by Polyspace.
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
, enableSet checkers by file (-checkers-selection-file)
.
Dependencies
This option is available only if you set
Source code language (-lang)
toC
orC-CPP
.For projects with mixed C and C++ code, the SEI CERT-C checker analyzes only
.c
files.
Command-Line Information
Use the command -cert-c
in the command line to check for violations
of CERT C rules and recommendations.
Parameter:
-cert-c |
Value:
all-rules | publish-2016 |
all | from-file |
Example (Bug Finder):
polyspace-bug-finder -lang c -sources |
Example (Bug Finder Server):
polyspace-bug-finder-server -lang c -sources
|
Alternatively, enable all or specific CERT C rules and recommendations through a checkers activation XML file. See
Checkers activation file
(-checkers-activation-file)
.