From 7638292099904207007
X-Google-Thread: f78e5,174aa7b34b06a51
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.speakeasy.net!news.speakeasy.net.POSTED!not-for-mail
NNTP-Posting-Date: Wed, 23 Nov 2005 22:50:05 -0600
Return-Path: <devnull@stump.algebra.com>
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
Delivered-To: std-c++@ucar.edu
From: pongba@gmail.com
Newsgroups: comp.std.c++
Subject: Re: Is this really unspecified behavior?
Organization: http://groups.google.com
Message-ID: <1132786459.216137.307610@z14g2000cwz.googlegroups.com>
References: <1132629737.664847.151630@o13g2000cwo.googlegroups.com>
   <1132722639.345095.296070@f14g2000cwb.googlegroups.com>
   <200511231401.jANE1BuC092897@horus.isnic.is>
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Complaints-To: groups-abuse@google.com
User-Agent: G2/0.2
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Maxthon; .NET CLR 2.0.50727),gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse@google.com
Injection-Info: z14g2000cwz.googlegroups.com; posting-host=222.94.28.3;
   posting-account=t_ay-g0AAADpcfWwZ2b8zZ89gVs9u18v
X-Greylisting: NO DELAY (Relay+Sender autoqualified);
	processed by UCSD_GL-v2.1 on mailbox8.ucsd.edu;
	Wed, 23 November 2005 14:54:25 -0800 (PST)
X-Spamscanner: mailbox8.ucsd.edu  (v1.6 Aug  4 2005 15:27:38, -2.6/5.0 3.0.4)
X-MailScanner: PASSED (v1.2.8 90804 jANMsOkx002607 mailbox8.ucsd.edu)
X-Virus-Scanned: amavisd-new at ucar.edu
X-Virus-Scanned: amavisd-new at cs.mu.OZ.AU
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
X-Virus-Scanned: amavisd-new at cs.mu.OZ.AU
Date: Wed, 23 Nov 2005 22:45:31 CST
Lines: 27
NNTP-Posting-Host: 65.182.171.162
X-Trace: sv3-etq1p/h5pjRMzm5zdOdxAR6LG2HuPz53FQoarECDVU5XWS2rmMHdD+aiQ6ZpOl+14U9VyDBDqPcjaXz!xmtzvBn9MpCa0UrEsaeLcbehZGW3V/yeo50++Je2CGWibeJVdHksvoGBipWw3OgtmZAly53N53xK!z+RV4LASmk2Z/4c/9cxeB1I9A7r4x/UkafROCbepcyM=
X-Complaints-To: abuse@speakeasy.net
X-DMCA-Complaints-To: abuse@speakeasy.net
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.32
Xref: g2news1.google.com comp.std.c++:2584

Hyman Rosen wrote:
> No, it's undefined in the built-in case, because i is modified
> twice in the same expression (by the increment and by the
> assignment) without an intervening sequence point.

yeah, that's where my doubt lies exactly. The standard says that "i =
v[i++]" has unspecified behavior, but according to what you have said,
it should just be undefined behavior.
Is there anything wrong with the corresponding standard wording?

BTW. If what you said is true, similarly the expression " i =
i++"/"i=++i"(whatever) would have undefined behavior,too. It's just
that I couldn't believe this little simple expression has undefined
behavior, though, I think you were right anyway.

Plus, to me it seems very, very confusing to separate the concept of
"evaluation" from that of "side-effect", in particular, the evaluation
of an expression doesn't necessarily mean that the side-effect of this
evaluation takes place simultaneously. Sometimes this behavior is quite
puzzling, it's just counterintuitive.

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]



