| Liste des Groupes | Revenir à cl c |
On 31/05/2026 10:49, David Brown wrote:As I said, they "do not affect the generated code unless they affect the semantics of the expression." Obviously that only applies to extra parentheses. If that's what you mean by "parsed differently", then we agree - clearly "(a + b) * c" gives different code from "a + (b * c)".On 31/05/2026 10:12, Richard Harnden wrote:They can do if they make a expression be parsed differently.On 31/05/2026 00:43, Keith Thompson wrote:>C's operator precedence rules are complicated and arguably flawed.>
They could have been defined differently. A simpler set of rules,
with fewer levels,*might* have been better. I don't have any
concrete suggestions -- nor do I have any strong preferences.
I accept C's rules as they are. I would accept them if they had
been defined differently.
Can't the compiler easily remove any parens that aren't necessary?
So - just write complex expressions in a way that a human can most easily understand, it makes your intention clear and probable doesn't increase the size of the executable.
>
>
Of course. Parentheses do not affect the generated code unless they affect the semantics of the expression. (Some people think parentheses affect the order of evaluation,
Do you have an example where they make no difference but people might think they do?People might think they affect the order of evaluation, such as when you have function calls :
Les messages affichés proviennent d'usenet.