DMD 0.164: Possible bug in order of evaluation
Stewart Gordon
smjg_1998 at yahoo.com
Fri Aug 18 02:57:13 PDT 2006
Klaus Oberhofer wrote:
> While porting some C-Code to D I had a possible bug that has to do with
> the order of evaluation of the post increment operator.
<snip>
> Could someone confirm this as a bug ?
No.
http://www.digitalmars.com/d/expression.html
"Evaluation Order
Unless otherwise specified, the implementation is free to evaluate the
components of an expression in any order. It is an error to depend on
order of evaluation when it is not specified. For example, the following
are illegal:
i = ++i;
c = a + (a = b);
func(++i, ++i);
If the compiler can determine that the result of an expression is
illegally dependent on the order of evaluation, it can issue an error
(but is not required to). The ability to detect these kinds of errors is
a quality of implementation issue."
Stewart.
More information about the Digitalmars-d-bugs
mailing list