[previous] 0565 [next] [C] Left operand of '+=' or '-=' must be of arithmetic or pointer to object type.
Constraint violations REFERENCE - ISO:C90-6.3.16.2 Compound Assignment - Constraints

This is a constraint error

The left hand operand of a += or -= operator must be of arithmetic type or "pointer to object" type.

For example:


/*PRQA S 488,2213,2216,3132,3227,3408,3447 ++*/

struct ST {int a; int b;};

extern struct ST sta;
extern int buf[10];
extern int g;
extern int *pi;

void foo(int n)
{
    sta += n;           /* Message 0565          */
    buf += n;           /* Message 0565 and 0556 */
    g   += n;
    pi  += n;
}

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