|
From: | Richard Crozier |
Subject: | Re: undefined compound chaining behavior |
Date: | Thu, 12 Jun 2014 16:58:51 +0100 |
User-agent: | Mozilla/5.0 (Windows NT 5.1; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 |
On 12/06/2014 16:48, Hossein Sajjadi wrote:
I talk about Standard and do not target any compiler. In c++11 the expression i=++i+1 is well defined but gcc 4.9 throws warning and a+=a+=4 is undefined but gcc throws no warning
Jordi's point is that just because you type a+=a+=4 at the Octave prompt, does not mean this expression is what is ever evaluated in C++ code. Octave does not write a little C++ file containing the a+=a+=4 expression and then compile and run it after all.
The expression is broken down by the interpreter code and evaluated in whatever way the interpreter was written to do it.
Richard -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.
[Prev in Thread] | Current Thread | [Next in Thread] |