Class (-class-analyzer
)
Specify classes that you want to verify
Description
This option affects a Code Prover analysis only.
Specify classes that Polyspace® uses to generate a main
.
Set Option
User interface (desktop products only): In your project configuration, the option is on the Code Prover Verification node. See Dependencies for other options that you must also enable.
User interface (Polyspace Platform, desktop products only): In your project configuration, the option is on the Static Analysis tab on the Run Time Errors node. See Dependencies for other options that you must also enable.
Command line and options file: Use the option
-class-analyzer
. See Command-Line Information.
Why Use This Option
If you are verifying a module or library, Code Prover generates
a main
function if one does not exist. If a main
exists,
the analysis uses the existing main
.
Use this option and the option Functions to call within the specified classes
(-class-analyzer-calls)
to specify the class methods that the
generated main
must call. Unless a class method is called
directly or indirectly from main
, the software does not analyze
the method.
Settings
Default: all
all
To generate a
main
function, Polyspace uses all classes that have at least one method defined outside a header file. The generatedmain
calls methods that you specify using the optionFunctions to call within the specified classes (-class-analyzer-calls)
.none
The generated
main
cannot call any class method.custom
To generate a
main
function, Polyspace uses classes that you specify. The generatedmain
calls methods from classes that you specify using the optionFunctions to call within the specified classes (-class-analyzer-calls)
.
Dependencies
You can use this option only if all of the following are true:
Your code does not contain a
main
function.Source code language (-lang)
is set toCPP
orC-CPP
.Verify module or library (-main-generator)
is selected.
Tips
If you select
none
for this option, Polyspace will not verify class methods that you do not call explicitly in your code.Polyspace does not verify templates that are not instantiated. To verify a class template, explicitly instantiate a class using the template. See Template Classes (Polyspace Code Prover).
Command-Line Information
Parameter: -class-analyzer |
Value: all | none | custom= |
Default: all |
Example (Code Prover): polyspace-code-prover
-sources |
Example (Code Prover
Server):
polyspace-code-prover-server -sources
|
See Also
Verify module or library (-main-generator)
| Functions to call within the specified classes
(-class-analyzer-calls)
| Analyze class contents only (-class-only)
| Skip
member initialization check (-no-constructors-init-check)
Topics
- Specify Polyspace Analysis Options
- Verify C++ Classes (Polyspace Code Prover)