![]() |
![]() |
3455 | ![]() |
||||
![]() | |||||||
| Preprocessing | |||||||
This macro argument includes a function call. A function call may generate side effects and there are several reasons why it is unwise to invoke a macro with an argument that induces side effects.
/*PRQA S 3199,3408,3429,3440,3447,3453 ++ */
#define MAC(P, Q) ((P) * (Q))
extern int foo(void);
extern int x;
extern int g;
extern void func(void)
{
g = MAC(foo(), x); /* Message 3455 */
}
extern int foo(void)
{
++x;
return x;
}
See also:
![]() | ||
| QA·C Source Code Analyser 8.1.2
© 2013 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | Contents |