In `#if`, the operand that is not evaluated must not cause an error (C11 6.5.13–6.5.15, used by 6.10.1). ```c #if 0 && (1/0) #endif ``` gcc: no error, condition is false. simplecpp: `syntax error: failed to evaluate #if condition, division/modulo by zero` | `#if` expression | gcc | simplecpp | |---|---|---| | `0 && (1/0)` | false | error: division/modulo by zero | | `1 \|\| (1/0)` | true | error: division/modulo by zero | | `1 ? 2 : (1/0)` | true | error: division/modulo by zero |
Activity
Fix #722 (#if: &&, || and ?: do not short-circuit)
Fix #722 (#if: &&, || and ?: do not short-circuit)
Fix #722 (#if: &&, || and ?: do not short-circuit)
Fix cppcheck-opensource#722 (#if: &&, || and ?: do not short-circuit) (…