[previous] 3320 [next] Type of argument no. %s differs from its type in definition of function.
Functions REFERENCE - ISO:C90-6.3.2.2 Function Calls

An argument in this function call is not compatible with the type of the corresponding parameter in the function definition. Message 3320 is only generated following the definition of a function using old style (K&R) syntax.

For example:


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


extern int f1(p)                /* Old style function definition */
const int *p;
{
   return (*p);
}

extern int f2(const int *p)     /* New style function definition */
{
   return (*p);
}


extern int foo(void)
{
   int ret;

   ret = f1(3);                 /* Message 3320 */

   ret = f2(3);                 /* Message 0432 - constraint error */

   return ret;
}


MISRA-C:2004 Rules applicable to message 3320:

Rule  8.3  (Required) For each function parameter the type given in the declaration and definition shall be identical, and the return types shall also be identical.


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