Comment

Comment by bla3

Here's what clang does with this code (https://godbolt.org/z/Ar2qt6):

  <source>:5:11: warning: & has lower precedence than ==; == will be evaluated first [-Wparentheses]
  int t = x & y == z;   // ?
            ^~~~~~~~
  <source>:5:11: note: place parentheses around the '==' expression to silence this warning
  int t = x & y == z;   // ?
            ^
              (     )
  <source>:5:11: note: place parentheses around the & expression to evaluate it first
  int t = x & y == z;   // ?
            ^
          (    )
Seems like a mostly solved problem.
parent bla3 6 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton