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

Table Of Contents
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
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:
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:
4239 case type mismatch with switch expression type
Cause:
The switch expression type does not match with the type of case labels.
Example:
enum BOOLEAN { TRUE = 0, FALSE = 1 };
BOOLEAN a_bool = TRUE;
switch(a_bool) {
case 0: printf("true\n");
case 1: printf("false\n");
default: printf("no match found \n");
}
Action:
Fix your source code to ensure the type of the switch expression and case labels is same.
Reference:
4235 conversion from %t1 to %t2 may lose significant bits 55