HP Code Advisor Diagnostics

};
template class X<int>;
Action:
Providing explicit instantiations for templates is a old programming style and it is not
recommended. Check if you really need to do explicit instantiations in your code.
Reference:
ANSI/ISO C++ 14.7.2
2513 a value of type %t1 cannot be assigned to an entity of type %t2
Cause:
The types of variables used in the assignment are incompatible.
Example:
long double d = 0.0;
char *c = 0;
c =
Action:
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:
48 Diagnostics Details