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
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
-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 |