2 ms·
Many of the strange things that happen in C language edge cases come about from macro expansion or code generation. Unrelated to the issue, but the superfluous
by jws 15y ago
Many of the strange things that happen in C language edge cases come about from macro expansion or code generation.
Unrelated to the issue, but the superfluous parenthesis added in the second example are interesting. I think every C coder has a level of comfort with the 15 sets in the operator precedence rules, and beyond that they throw parenthesis at it. I'm fine with the rules until I use a <<, >>, &, ^, or |[1]. Then I drag out the parenthesis.
[1] I swear the positions of the ones I named are placed alphabetically rather than in relation to their mathematical function.
- gsg 15y ago& and | have the wrong precedence because in primordial C they were both either short-circuiting boolean or bitwise depending on context. :(