HP Code Advisor Diagnostics

typedef char* caddr;
int main() {
caddr data = "0x1";
if (data == DT)
return 1;
}
Action:
Avoid such incompatible type conversions.
Reference:
C99 6.3.2.3
2167 argument of type %t1 is incompatible with parameter of type %t2
Cause:
The parameter type passed is incompatible with the function argument type.
Example:
typedef char * addr;
int foo(int a) {
return a;
}
int main() {
addr data = "0x1";
foo(data);
return 0;
}
Action:
Pass the parameter type that is compatible with the function argument type.
Reference:
2170 pointer points outside of underlying object
Cause:
When a pointer to an object is not initialized, the offset might lie outside the base object. Hence,
the behavior might be undefined.
Example:
Action:
Initialize the pointer.
Reference:
2172 external/internal linkage conflict with previous declaration %nod
Cause:
The linkage of a declaration conflicts with the linkage specified in an earlier declaration.
Example:
extern void bar();
static void bar(){}
Action:
Change one of the declarations so that the linkages match.
Reference:C99 6.2.2.7
2167 argument of type %t1 is incompatible with parameter of type %t2 33