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

Table Of Contents
return 0;
}
Action:
Remove the extern storage class specifier in function definition.
Reference:
4245 storage class used with a data definition
Cause:
The compiler has detected the usage of an extern storage class specifier with a data definition.
Example:extern int i = 1;
Action:
Remove the extern storage class specifier in the data definition.
Reference:
4247 function called with different argument counts (%s vs. %s2)
Cause:
Two calls to an unprototyped function differ in the number of arguments being passed, at least one
of these calls is passing wrong arguments.
Example:
int main() {
foo(10);
foo(10, 100);
}
Action:
Correct the function call which is passing wrong number of arguments. Preferably declare the
function before calling it.
Reference:
4248 comparison of unsigned integer with a signed integer
Cause:
This occurs due to mixing signed and unsigned operands with relational operators <, ≤, >, ≥.
One of the operands in signed and the other unsigned. The signed quantity may be negative as
well.
Example:
int a = -1;
unsigned int b = 1;
if (a < b)
return a;
Action:
To resolve this problem, either cast the integer to unsigned if you know it can never be less than
zero or cast the unsigned to a signed int if you know it can never exceed the maximum value of
int.
Reference:
4249 64 bit migration: value could be truncated before cast to bigger
sized type.
Cause:
4245 storage class used with a data definition 57