Re: bugs in c

From: Richard Bos (rlb_at_hoekstra-uitgeverij.nl)
Date: 10/16/03


Date: Thu, 16 Oct 2003 11:13:30 GMT

Joona I Palaste <palaste@cc.helsinki.fi> wrote:

> So now the rule of thumb when dealing with C operator precedence is:
> "If in doubt, use parantheses like they're going out of fashion."

Hmmm... no. I find the precedence of C operators quite sensible, with
some glaring exceptions. Those exceptions are the bitwise operators,
which are wrong; and the shift operators, and the relative positions of
the ternary and assignment operators, for which no solution is
definitely right. Around them, I parenthesise. Around the others, I
don't see why it would be necessary.
And I'll remark that your rule of thumb would mean that many people
would follow fashion and stop using parentheses at all...

Richard