In my opinion the right approach would be for the docs to clearly state that the order is not specified. Then the compiler may change the order and still be playing by the rules. This might be needed for optimization, which is why the C standard left the order unspecified. This applies to the operands needed by an operator as well as to arguments needed by a function.
The usual trick is to do the more complicated evaluation first. For example, suppose that b() needs more registers than a() and we want to evaluate the expression
a() + b()
as efficiently as possible. Perhaps this can be done entirely in registers only by evaluating b() before a().
Thus a() + b() needs a different left-to-right order than b() + a().
The usual trick is to do the more complicated evaluation first. For example, suppose that b() needs more registers than a() and we want to evaluate the expression
a() + b()
as efficiently as possible. Perhaps this can be done entirely in registers only by evaluating b() before a().
Thus a() + b() needs a different left-to-right order than b() + a().