...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
#include <iostream> void f() { int i = 0; decltype(i) h = 12; ++i; std::cout << i; } |
Exceptions
EXP32EXP52-CPP-EX1: It is permissible for an expression with side effects to be used as an unevaluated operand in a macro definition or substitution failure is not an error (SFINAE) context. Although these situations rely on the side effects to produce valid code, they typically do not rely on values produced as a result of the side effects.
...
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
Related Guidelines
SEI CERT C Coding Standard | EXP44-C. Do not rely on side effects in operands to sizeof, _Alignof, or _Generic |
...