[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: chaining compound assignment results in undefined behavior
From: |
Jordi Gutiérrez Hermoso |
Subject: |
Re: chaining compound assignment results in undefined behavior |
Date: |
Fri, 06 Jun 2014 15:03:03 -0400 |
On Fri, 2014-06-06 at 20:53 +0330, Hossein Sajjadi wrote:
> the expression a=1;a+=a+=4 may be evaluated 6 sometimes or may be
> evaluated 10 in other situations such as change of compiler or
> multi thread execution ...
In C++, yes. Not in Octave. The result is always going to be 10 in
Octave. There is no concept of "undefined behaviour" in the Octave
language.
- Jordi G. H.