From -4796970556166950366
X-Google-Thread: f78e5,174aa7b34b06a51
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news1.google.com!news3.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: Tue, 29 Nov 2005 21:40:14 -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: "Sandor  Hojtsy" <sandor.hojtsy@gmail.com>
Newsgroups: comp.std.c++
Subject: Re: Is this really unspecified behavior?
Organization: http://groups.google.com
Message-ID: <1133276211.452281.106150@f14g2000cwb.googlegroups.com>
References: <1132629737.664847.151630@o13g2000cwo.googlegroups.com>
   <1132722639.345095.296070@f14g2000cwb.googlegroups.com>
   <200511231401.jANE1BuC092897@horus.isnic.is>
   <hj1hf.4529$N45.2609@newsread1.news.atl.earthlink.net>
   <37hco1hvfg2s43q2dv3003her7im99airg@4ax.com>
   <uk6eun0ad.fsf@boost-consulting.com>
   <1twif.776$iZ3.758@trndny03>
   <1133189252.960738.262510@g44g2000cwa.googlegroups.com>
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/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7,gzip(gfe),gzip(gfe)
X-HTTP-Via: 1.1 esprx01 (NetCache NetApp/5.6.2R1)
Complaints-To: groups-abuse@google.com
Injection-Info: f14g2000cwb.googlegroups.com; posting-host=192.100.124.218;
   posting-account=DX672Q0AAAC663CjjQDK-b4rLiwACZK0
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: Tue, 29 Nov 2005 21:30:55 CST
Lines: 26
NNTP-Posting-Host: 65.182.171.162
X-Trace: sv3-e22zDkjLnIY2DH5Ep5dfe1w3EzvEquVlazbCZfdAECYNA4PDTsWRZYXWbkVum9dZLUY6xG7Qxazkd2Q!K+SqDu/A8LCPVRGXMl0Vszcl7i6uJLFo7hjiHlG5uWnMBeoI0PZIYdH2c7ss16egBfhhT4qGHU0I!s5DI/LvWq8XMK8ScSuBvI/2ifxVfQwUuUw9cNW5ONkk=
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++:2629

You keep quoting the standard:
  i = v[i++];                     // the behavior is unspecified
  i = 7, i++, i++;                // i becomes 9
  i = ++i + 1;                    // the behavior is unspecified
  i = i + 1;                      // the value of i is incremented
Note that this contains an identified defect, it should correctly read:
i = v[i++];                     //  the behavior is undefined
i = 7, i++, i++;                //   i  becomes  9
i = ++i + 1;                    //  the behavior is undefined
i = i + 1;                      //  the value of  i  is incremented
See http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#351

I have a question: are these expressions undefined, or well-formed?
i = i = 1;
i = ++i;
a = (i = 1) + (i = 1);
If I take the standard word by word, they do not modify the value of i
twice in an expression, because one of the assignments is not
modification - just reassigning the existing value.

---
[ 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                       ]



