Skip member initialization check (-no-constructors-init-check
)
Do not check if class constructor initializes class members
Description
This option affects a Code Prover analysis only.
Specify that Polyspace® must not check whether each class constructor initializes all class members.
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
-no-constructors-init-check
. See Command-Line Information.
Why Use This Option
Use this option to disable checks for initialization of class members in constructors.
Settings
- On
Polyspace does not check whether each class constructor initializes all class members.
- Off (default)
Polyspace checks whether each class constructor initializes all class members. It checks for initialization of:
Integer types such as
int
,char
andenum
, bothsigned
orunsigned
.Floating-point types such as
float
anddouble
.Pointers.
The analysis uses built-in functions
__ps_builtin_check_NIV()
and__ps_builtin_check_NIP()
in the generatedmain
to perform these checks. If the Code Prover analysis proves that a class member is not initialized in the constructor, you see a red check on this member in a call to the function__ps_builtin_check_NIV()
. If the analysis cannot prove definite initialization or non-initialization of a class member in the constructor, you see an orange check.
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.
If you select this option, you must specify the classes using the Class
(-class-analyzer)
option.
Command-Line Information
Parameter: -no-constructors-init-check |
Default: Off |
Example (Code Prover):
polyspace-code-prover -sources |
Example (Code Prover Server):
polyspace-code-prover-server -sources |