Main Content

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 generated main calls methods that you specify using the option Functions 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 generated main calls methods from classes that you specify using the option Functions to call within the specified classes (-class-analyzer-calls).

Dependencies

You can use this option only if all of the following are true:

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=class1[,class2,...]
Default: all
Example (Code Prover): polyspace-code-prover -sources file_name -main-generator -class-analyzer custom=myClass1,myClass2
Example (Code Prover Server): polyspace-code-prover-server -sources file_name -main-generator -class-analyzer custom=myClass1,myClass2