HP Code Advisor Diagnostics

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:
2656 transfer of control into a try block
Cause:
Goto statements cannot be used to transfer control inside the try blocks.
Example:
goto LABEL;
try {
LABEL:
throw 0;
} catch(...) {
}
Action:
Remove the goto statement that transfers the control inside the try block.
Reference:
ANSI/ISO C++ 15(2)
2767 conversion from pointer to smaller integer
Cause:
The 64-bit pointer is being cast to an integer type that is smaller in size. Casting a 64-bit pointer
to a smaller integer type is undefined behavior. This also could indicate code that relies on
pointers and integers being the same size. The code will cause an unexpected loss of data on
64-bit platforms.
Example:
int *p = 0;
int i = (int) p;
Action:
If this is the intended behavior, first cast the pointer to a 64-bit integer, then cast the result to the
desired integer type.
Reference:
2550 %n was set but never used 49