HP Code Advisor Diagnostics

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:
4241 redeclaration, function %nod was previously called without a
prototype
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:
4242 No prototype or definition in scope for call to %sq
Cause:
4237 type cast from %t1 to %t2 may cause sign extension to a larger size integer. 59