[previous] 1331 [next] Type or number of arguments doesn't match previous use of the function.
Functions

The number or type of the arguments in this function call is different from those in a previous call to the same function. This is a dangerous situation and suggests that at least one of the function calls is incorrect. This message will only be generated when the function is being called and has not previously been declared with a prototype declaration. See message 3335.

It is always advisable to use function prototypes consistently throughout your source code; but be aware that it can be dangerous to use them in some places but not in others. When functions are called in the absence of a prototype, arguments of type char, short and float are subject to default argument promotion.

For example:


/*PRQA S 1302,2017,3198,3199,3203,3227,3330,3408 ++*/

void test(int a, long b)
{
    int r;

    r = foo(a);                       /* Message 3335 */
    r = foo(b);                       /* Message 1331 */
    r = foo(a, b);                    /* Message 1331 */
}


MISRA C:2012 Rules applicable to message 1331:

Rule-1.3  (Required) There shall be no occurrence of undefined or critical unspecified behaviour


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