Re:Dennis Ritchie’s first C compiler (c. 1972)
by colejohnson66 on Friday March 12, 2021 @03:42PM
(#26440634)
I meant equals having a higher precedence than bitwise AND.
As in:
if (x & 2 == 2)
...is actually parsed as: if (x & (2 == 2))
...which isn’t intuitive.
Re:Dennis Ritchie’s first C compiler (c. 1972)
by compiler-guy on Friday March 12, 2021 @05:42PM
(#26441853)
See the above example from dmr himself
Why is this precedence weird? Bitwise AND tends to be used to transform data while a logical AND tends to be used for control flow.