News for hackers. Stuff that matters.
Re:We need to talk about parentheses by tempodox on Monday February 12, 2024 @07:15AM (#39343986)
The reason why this expression shouldn't compile has nothing to do with precedences (C has some odd choices here to be sure), but because of mixing incompatible types. Arithmetic integers, bitvector integers, Booleans, and possibly even floats. Conversions to appropriate types should have to be explicit. But C's type system is weak as all hell and this shit actually compiles there. (I'm only mentioning C because your example looks like it.)
Re:We need to talk about parentheses by rfl890 on Monday February 12, 2024 @07:49AM (#39344208)
There‘s no implicit type conversion here. As long as all the vars are the same type it works (albeit unpredictable if you don‘t know operator precedence for the lang).