HP Code Advisor Diagnostics Reference Guide (5900-1865, July 2011)

For 64 bit portability ensure that your code does not convert from int to pointer or long and vice
versa.
Reference:
2.107 4232 conversion from %t1 to a more strictly aligned type %t2 may
cause misaligned access
Cause:
A pointer is being cast from a lesser aligned type to a more strictly aligned type. Accesses using
the new type may cause misaligned access.
Example:
int foo(int* p, long long* l) {
l = (long long*) p; // warning 4232 here
}
Action:
Correct the code that uses such conversions.
Reference:
ANSI/ISO C++ 3.9, 3.9.1, 3.9.2
2.108 4235 conversion from %t1 to %t2 may lose significant bits
Cause:
The destination of an assignment has less range/precision than the source operand, this might
cause a loss of value/precision.
Example:
int i = 10;
double l = 10.345;
int j = l/i;
Action:
Change the type of the destination or if the loss in significant bits is not a concern add a cast.
Reference:
2.109 4237 type cast from %t1 to %t2 may cause sign extension to a
larger size integer.
Cause:
A signed integer constant is being converted to a larger unsigned integral type. The conversion
might cause sign # extension leading to a larger value than expected.
Example:
typedef unsigned long long uint64_t;
int i = -1;
uint64_t a = (uint64_t) i;
Action:
Verify if the type cast behavior is intended.
Reference:
2.110 4239 case type mismatch with switch expression type
Cause:
2.107 4232 conversion from %t1 to a more strictly aligned type %t2 may cause misaligned access 55