![]() |
![]() |
3452 | ![]() |
||||
![]() | |||||||
| Macro Definition | |||||||
This object-like macro appears to expand to an arithmetic expression which is not parenthesized. Confusion could arise if the macro is used in a context where operators are adjacent to the macro and operator precedence becomes significant. Message 3452 is generated when an object-like macro contains an operator (other than # or ##) and the operator is not bounded within the replacement list by either ( ), [ ], { } or < >, For example:
/*PRQA S 3120,3199,3203,3361,3395,3401,3408,3412,3447,3459 ++ */
#define A -5 /* Message 3452 */
#define B x + y /* Message 3452 */
#define C (x + y) /* */
#define D [x + y] /* */
#define E do {x++; y++; z = x + y;} while (0) /* */
extern int x;
extern int y;
extern int z;
extern void foo(void)
{
int r;
r = 2 * B;
E;
}
No MISRA C:2012 Rules applicable to message 3452
See also:
![]() | ||
| 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 |