[previous] 3454 [next] Macro argument contains an increment, decrement or assignment operator.
Preprocessing

This macro argument includes an increment, decrement or assignment operator.

These are operators that generate side effects and there are several reasons why it is unwise to invoke a macro with an argument that induces side effects.

For example:


/*PRQA S 3199,3408,3429,3440,3447,3453 ++ */

#define MAC1(X) ((X) * foo(2))

extern int foo(int p);
extern int g;


extern void func(int sia)
{
    g = MAC1(sia++);                     /* Message 3454 */
}


No MISRA-C:2004 Rules applicable to message 3454


See also:

QA·C Source Code Analyser 8.1
MISRA-C:2004 Compliance Module 3.2
© 2012 Programming Research.
www.programmingresearch.com
Personality Groups | Glossary | Message Index | MISRA-C:2004 Rule Index Contents