...
In this noncompliant code example, the expression a++
is not evaluated, and the side effects in the expression are not executed:
Code Block | ||||
---|---|---|---|---|
| ||||
void func(void) { int a = 14; int b = sizeof(a++); } |
...
In this compliant solution, the variable a
is incremented outside of the sizeof
operation:
Code Block | ||||
---|---|---|---|---|
| ||||
void func(void) { int a = 14; int b = sizeof(a); ++a; } |
...