...
Code Block | ||
---|---|---|
| ||
#define ABS(x) ({int __xtmp = (x); __xtmp < 0 ? -__xtmp : __xtmp; }) |
Risk Assessment
Defining an unsafe macro leads invocations of the macro with an argument that has side effects, causing those side effects to occur more than once. This can lead to unexpected or undefined program behavior.
...
This rule appears in the C++ Secure Coding Standard as PRE33PRE12-CPP. Never invoke an unsafe macro with arguments containing assignment, increment, decrement, volatile access, or function callDo not define unsafe macros.
References
Wiki Markup |
---|
\[[ISO/IEC 9899:1999|AA. C References#ISO/IEC 9899-1999]\] Section 5.1.2.3, "Program execution" |
...