[previous] 0429 [next] [C] Function argument is not of arithmetic type.
Constraint violations REFERENCE - ISO:C90-6.3.2.2 Function calls

This is a constraint error

A function parameter of arithmetic type has been passed an argument which isn't of arithmetic type - maybe it's a pointer or a 'struct' or a 'union'. For example:


/*PRQA S 750,759,2213,2216,3132,3408,3447,3623,3625 ++ */
extern void foo(int p);

struct ST1 { int si; char sbuf[10];};
union  UN1 { int ui; int uj;};

extern struct ST1 st1a;
extern union  UN1 un1a;

extern int *pi;
extern int gi;


extern void test(void)
{
    foo(gi);                  /* OK           */
    foo(pi);                  /* Message 0429 */
    foo(&gi);                 /* Message 0429 */
    foo(st1a);                /* Message 0429 */
    foo(un1a);                /* Message 0429 */
}

QA·C Source Code Analyser 8.1.2
© 2013 Programming Research.
www.programmingresearch.com
Personality Groups | Glossary | Message Index Contents