HP-UX Cadvise Diagnostics Reference Guide (5900-1865, August 2012)

Table Of Contents
Check if the assignment is required and if it is valid. If valid, use an explicit cast to force the
assignment.
Reference:
2546 transfer of control bypasses initialization of: "variable"
Cause:
Compiler has detected transfer of control was attempted that bypasses initialization of a variable.
Example:
int main() {
goto LABEL;
int i = 20;
LABEL:
printf("jumped to LABEL\n");
}
Action:
Rewrite the code such that declarations/initializations are not provided within the code segment
which can be bypassed because of explicit transfer of control.
Reference:
2549 "variable" is used before its value is set
Cause:
A variable's value has been used without being set. The algorithms that detect this situation only
report it once for a given variable, and not necessarily at the first use of the uninitialized value.
Example:
int i;
printf("%d", i);
Action:
Provide the variable with a value before the variable is used. If you only provide a value for the
use reported here, you may find that when you recompile your program another uninitialized use
is detected. It is best to initialize variables as close as possible to the point of declaration.
Reference:
2550 %n was set but never used
Cause:
This identifier is set but never referenced in the current translation unit.
Example:
int main() {
int var;
var = 20;
}
Action:
Examine your code to determine if this definition is needed in this module.
Reference:
2546 transfer of control bypasses initialization of: "variable" 45