From -7536935838260011913
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: Tue, 06 Dec 2005 21:40:38 -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: "ThosRTanner" <ttanner2@bloomberg.net>
Newsgroups: comp.std.c++
Subject: Re: Is this really unspecified behavior?
Organization: http://groups.google.com
Message-ID: <1133887764.580879.73650@g44g2000cwa.googlegroups.com>
References: <1132629737.664847.151630@o13g2000cwo.googlegroups.com>
   <1132662585.882464.24110@f14g2000cwb.googlegroups.com>
   <E1EeZw5-0004wI-00@chx400.switch.ch>
   <XBQgf.150724$zb5.113482@bgtnsc04-news.ops.worldnet.att.net>
   <1132759176.368850.264850@g43g2000cwa.googlegroups.com>
   <H1phf.161529$zb5.99785@bgtnsc04-news.ops.worldnet.att.net>
   <1132933832.802917.153350@g14g2000cwa.googlegroups.com>
   <1133551647.532929.325730@z14g2000cwz.googlegroups.com>
   <1133583412.951239.208510@g49g2000cwa.googlegroups.com>
   <E1EjGBD-0005T8-00@chx400.switch.ch>
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.8) Gecko/20051111 Firefox/1.5,gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse@google.com
Injection-Info: g44g2000cwa.googlegroups.com; posting-host=199.172.169.15;
   posting-account=WDL57QwAAADh6I7Opo5K2PCbyz8hJhRA
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,  6 Dec 2005 21:34:22 CST
Lines: 34
NNTP-Posting-Host: 65.182.171.162
X-Trace: sv3-a7GQqfJSFdso7pz7Te8J75qZVMgXzjzkFqvkeICWinnxNlqalKoNGlDUEJCyijc+ShPnYSvbLrDpslm!X/03xVy1P7mX2PLNvMchVOevu1ioItl9XobJ6Ze+JmviY4BGWfBtO28DNMmBiziPU1Qr/bCezDPo!MuFv6QkofUS1rlKiI8sWxlibsJa/LKYzLRaFzVnaig==
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++:2680


Hyman Rosen wrote:
> kuyper@wizard.net wrote:

> > I wouldn't have used the phrase "probably", if I knew for certain that
> > any such idioms exist.
>
> I don't know for sure, but one guess would be code like this,
>      cout << "xxx" << f() << "yyy" << g() << "zzz" << h() << "\n";
> where the authors don't realize that the function calls can
> happen in any order. The compiler which they use happens to give
> them an order which works, but there may be some particular order
> of evaluation which would be bad, and it silently lurks in the
> code until one day it shows up because of some change to compiler
> version.
>
> I would say that the apparent semantics of this code (first print
> this, then that, then that) are so strong that it takes unusual
> mental effort to realize that the calls are not (necessarily) made
> left-to-right.
Isn't that one situation where it will work as expected, because it
"translates to":

operator<<(operator<<(operator<<(operator<<(cout, "\n"), h()), "zzz"),
g(), "yyy") etc etc

and there's a sequence point after every function call

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



