...
Code Block |
---|
int a = 81 / ((++i) * (++i) * (++i)); |
which is undefined . (See see EXP30-C. Do not depend on the order of evaluation for side effects).)
Compliant Solution
When the macro definition is replaced by an inline function, the side effect is executed only once before the function is called:
...
Tool | Version | Checker | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
| CC2.PRE00 | Fully implemented | |||||||
| 340 S | Enhanced Enforcementenforcement | |||||||
PRQA QA-C |
| 3453 | Fully implemented |
...