HP Code Advisor Diagnostics Reference Guide (5900-1865, July 2011)
2.156 20035 variable %s is used before its value is set
Cause:
The compiler has detected use of a variable's value before it is set.
Example:
int func(int b)
{
int a;
a = a + b; // warning 20035 for use of variable a
return a;
}
Action:
Initialize the reported variable with a value before it is used. This may not be the only use of the
uninitialized value. So it is best to initialize variables as close as possible to the point of declaration.
Reference:
2.157 20036 variable %s (field %s) is used before its value is set
Cause:
The compiler has detected use of a member of a struct variable before it's value is set.
Example:
struct foo
{
int a;
int b;
};
int func()
{
struct foo x;
x.a = x.b + 10; // warning 20036 for use of field b
return 0;
}
Action:
Initialize the struct member with a value before it's use. This may not be the only use of the
uninitialized value. So it is best to initialize the field as close as possible to the point of struct
variable declaration.
Reference:
2.158 20037 variable %s may be used before its value is set
Cause:
The compiler has detected use of a variable which might not always be used initialized before this
use. One or more execution paths that lead to this use do not initialize this variable.
Example:
int func(int a)
{
int b,c;
if (a > 10)
b = a;
c = b + 10; // warning 20037 for use of variable b
return c;
}
Action:
2.156 20035 variable %s is used before its value is set 71