Static Analysis Problem Type Reference
The type of an actual argument does not match the corresponding formal parameter at a subroutine call.
This error usually indicates that the function declaration in force at the call site is inconsistent with the function definition. It can also result from misuse of intrinsic functions, although this is usually caught during ordinary compilation.
This same kind of error can also happen when a FORTRAN dummy argument of type subroutine is invoked. That is, the subroutine that is invoked through a dummy argument might exhibit the same problem as can occur in a direct call. In this case, the problem may or may not happen depending on what subroutine was passed to the dummy argument of subroutine type. There will be an additional code location in such cases that identifies the call site where the subroutine argument was passed in.
When this error occurs at a call to an intrinsic function, the code location that identifies the place where the called subroutine was defined will be absent.
|
ID |
Code Location |
Description |
|---|---|---|
|
1 |
Call site |
The place where the function was called with bad arguments |
|
2 |
Definition |
The place where the function was defined |
#include <stdio.h>
void f(double d) {
printf("d = %g\n", d);
}
file2.c:
extern void f(int x); // external declaration doesn't match definition
int main(int argc, char **argv)
{
f(1); // will pass integer; function expects double
return 0;
}