Analyze class contents only (-class-only
)
Do not analyze code other than class methods
Description
This option affects a Code Prover analysis only.
This option is not available for code generated from MATLAB® code or Simulink® models.
Specify that Polyspace® must verify only methods of classes that you specify using the option
Class (-class-analyzer)
.
Set Option
Set the option using one of these methods:
Polyspace user interface (desktop products only): In your project configuration, select the Code Prover Verification node and then select this option.
Polyspace Platform user interface (desktop products only): In your project configuration, on the Static Analysis tab, select the Run Time Errors node and then select this option. See Dependencies for other options that you must enable first.
Command line and options file: Use the option
-class-only
. See Command-Line Information.
Why Use This Option
Use this option to restrict the analysis to certain class methods only.
You specify these methods through the options:
When you analyze a module or library, Code Prover generates a
main
function if one does not exist. The
main
function calls class methods using these two options and
functions that are not class methods using other options. Code Prover analyzes these
methods and functions for robustness to all inputs. If you use this option, Code
Prover analyzes the methods only.
Settings
On
Polyspace verifies the class methods only. It stubs functions out of class scope even if the functions are defined in your code.
Off (default)
Polyspace verifies functions out of class scope in addition to class methods.
Dependencies
You can use this option only if all of the following are true:
Source code language (-lang)
is set toCPP
orC-CPP
.Verify module or library (-main-generator)
is selected.
If your code contains a main
function, this option is ignored.
Tips
Use this option:
For robustness verification of class methods. Unless you use this option, Polyspace verifies methods that you call in your code only for your input combinations.
In case of scaling.
Command-Line Information
Parameter: -class-only |
Default: Off |
Example (Code Prover):
polyspace-code-prover -sources |
Example (Code Prover Server):
polyspace-code-prover-server -sources |