Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Notional operations Rule 10.1
#4
The C language DOESN'T define the order of evaluation of operands except in some circumstances (see paragraph 3 of Section 6.3 of the (C90) standard).

The standard DOES state that the precedence and associativity of operators are defined by the grammar (Section 6.3 footnote 35).

The actual order in which the compiler performs evaluations isn't specified but the result MUST, for all operand values, be the same as if the operations had been performed in accordance with the precedence and associativity rules.

I therefore think that I incorrectly asserted a left to right order.

u16a + u16b + u32c

is subject to unspecifed behaviour, and may compute the left-most addition in either 16 bit or 32 bit on a 16 bit machine.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)