[previous] 0557 [next] [C] Right operand of assignment is not of arithmetic type.
Constraint violations REFERENCE - ISO:C90-6.3.16 Assignment Operators - Constraints

This is a constraint error

An object of arithmetic type has been assigned the value of an expression 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,3198,3199,3203,3210,3205,3408,3447,3623,3625 ++ */

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 char cbuf[10];

extern void test(void)
{
    int x;

    x = gi;                /*              */
    x = st1a;              /* Message 0557 */
    x = un1a;              /* Message 0557 */
    x = cbuf;              /* Message 0557 */
    x = pi;                /* Message 0557 */
}

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