Argument count mismatch

The number of actual arguments does not match the number of formal parameters at a call.

This error can result in stack corruption when the run time conventions dictate that the callee pop arguments onto the stack, as is usually the case.

Note that 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 observation in such cases that identifies the call site where the subroutine argument was passed in.

ID

Observation

Description

1

Call site

The actual arguments that were passed

2

Definition

The definition of the function

Example

file1.c:
       

extern int f(int a, int b); // incorrect declaration

int main(int argc, char **argv)
{
   return (f(1, argc)); // bad: call site passes two actual arguments
}
        
file2.c:
          
    // definition shows one formal parameter
    int f(int a)
    {
        return (a);
    }
        

Copyright © 2010, Intel Corporation. All rights reserved.