From -6274212024486958478
X-Google-Thread: f78e5,174aa7b34b06a51
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news1.google.com!news4.google.com!news.glorb.com!newsgate.cistron.nl!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.icl.net!newsfeed.fjserv.net!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!stump.algebra.com!devnull
From: bop@gmb.dk ("Bo Persson")
Newsgroups: comp.std.c++
Subject: Re: Is this really unspecified behavior?
Date: Wed,  7 Dec 2005 03:33:39 GMT
Lines: 41
Sender: mail2news@demon.net
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <3vlsa2F16leqsU1@individual.net>
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>
NNTP-Posting-Host: news.news.demon.net
X-Trace: news.demon.co.uk 1133926433 21942 158.152.254.254 (7 Dec 2005 03:33:53 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Wed, 7 Dec 2005 03:33:53 +0000 (UTC)
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
X-Priority: 3
X-Greylisting: NO DELAY (Relay+Sender autoqualified);
	processed by UCSD_GL-v2.1 on mailbox8.ucsd.edu;
	Tue, 06 December 2005 08:24:36 -0800 (PST)
X-Orig-X-Trace: individual.net hXT3krZHnybPDer3WhEJjgyx7T+myVMSD380TsJ8KRXt7L2VZv
X-RFC2646: Format=Flowed; Response
X-Virus-Scanned: amavisd-new at cs.mu.OZ.AU
X-MSMail-Priority: Normal
X-Received: (from fjh@localhost)
	by mulga.cs.mu.OZ.AU (8.12.10+Sun/8.12.9/Submit) id jB73XdOq004088;
	Wed, 7 Dec 2005 14:33:39 +1100 (EST)
X-Path: comp-std-cpp-robomod!not-for-mail
X-Delivered-To: std-c++@ucar.edu
X-Spamscanner: mailbox8.ucsd.edu  (v1.6 Aug  4 2005 15:27:38, 1.2/5.0 3.0.4)
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-Newsgroups: comp.std.c++
X-MailScanner: PASSED (v1.2.8 13801 jB6GOY3p034399 mailbox8.ucsd.edu)
Xref: g2news1.google.com comp.std.c++:2671


"Hyman Rosen" <hyrosen@mail.com> skrev i meddelandet 
news:E1EjGBD-0005T8-00@chx400.switch.ch...
> kuyper@wizard.net wrote:
>>>I think it would be helpful for your cause to list those 
>>>widely-used
>>>idioms. Personally, I can't think of a widely-used idiom that 
>>>depends
>>>on a particular evaluation order, and to the best of my knowledge 
>>>any
>>>such idiom should merely be considered broken. However, if you know 
>>>of
>>>any such idioms, I'd be interested to hear about them.
>>
>>
>> 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.

If the functions really affect each other, this is *really* bad code. 
Why don't we require a diagnostic

Warning: Terrible code - please rewrite!

instad of having the compilers make it work anyway?


Bo Persson


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



