[previous] 0466 [next] [C] Unary '+' requires arithmetic operand.
Constraint violations REFERENCE - ISO:C90-6.3.3.3 Unary Arithmetic Operators - Constraints

This is a constraint error

The operand of the unary '+' operator must be of arithmetic type. Check the type of the operand. For example:


/*PRQA S 2213,3408,3447,3600,3617 ++*/


struct ST { int x; };

extern struct ST field1;
extern struct ST field2;

extern int *p1;
extern int *p2;

void foo(void)
{
    field2 = +field1;               /* Message 0466 */
    p2 = +p1;                       /* Message 0466 */

}


MISRA C:2012 Rules applicable to message 0466:

Rule-1.1  (Required) The program shall contain no violations of the standard C syntax and constraints, and shall not exceed the implementation's translation limits


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