You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
#if: && and || are evaluated with the same precedence #716
&& has higher precedence than || (C §6.5.13–6.5.14, C++ [expr.log.and], [expr.log.or]), but simplecpp folds both operators in a single pass from left to right.
#if1||1&&0X#endif
gcc and clang output X, because the condition is 1 || (1 && 0). simplecpp evaluates it as (1 || 1) && 0 and drops X.
The alternative spellings have the same problem: #if 1 or 1 and 0.
Activity
Fix cppcheck-opensource#716 (#if: && and || are evaluated with the sa…