[previous] 3319 [next] [U] Function called with number of arguments which differs from number of parameters in definition.
Explicitly undefined REFERENCE - ISO:C90-6.3.2.2 Function Calls

This function has been called with the wrong number of arguments.

Message 3319 is only generated when the function definition is provided by an old style function header. If the function interface has been defined with a new style (prototype) header, messages 0422 or 0423 will be generated instead.

For example:


/*PRQA S 1304,2017,3002,3120,3198,3227,3408 ++*/

extern int f1(x, y)             /* Old style function definition */
int x;
int y;
{
    return(x + y);
}

extern int f2(int x, int y)     /* New style function definition */
{
    return(x + y);
}


extern int foo(void)
{
    int r;

    r = f1(34);                 /* Message 3319 */

    r = f2(34);                 /* Message 0422 */

    r = f2(34, 14, 23);         /* Message 0423 */

    return r;
}


MISRA-C:2004 Rules applicable to message 3319:

Rule  1.2  (Required) No reliance shall be placed on undefined or unspecified behaviour.
Rule  16.6  (Required) The number of arguments passed to a function shall match the number of parameters.


See also:

QA·C Source Code Analyser 8.1
MISRA-C:2004 Compliance Module 3.2
© 2012 Programming Research.
www.programmingresearch.com
Personality Groups | Glossary | Message Index | MISRA-C:2004 Rule Index Contents