From 4006320892912107929
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!newsfeed.stueberl.de!newsfeed.vmunix.org!peer-uk.news.demon.net!kibo.news.demon.net!mutlu.news.demon.net!news.demon.co.uk!demon!stump.algebra.com!devnull
From: dave@boost-consulting.com (David Abrahams)
Newsgroups: comp.std.c++
Subject: Re: Is this really unspecified behavior?
Date: Mon, 28 Nov 2005 00:13:51 GMT
Lines: 54
Sender: mail2news@demon.net
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <ubr05k5xw.fsf@boost-consulting.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>
	<438a14c4$0$28499$9a6e19ea@news.newshosting.com>
NNTP-Posting-Host: news.news.demon.net
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.demon.co.uk 1133136841 103 158.152.254.254 (28 Nov 2005 00:14:01 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Mon, 28 Nov 2005 00:14:01 +0000 (UTC)
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (windows-nt)
X-DMCA-Complaints-To: abuse@rcn.net
X-Virus-Scanned: amavisd-new at cs.mu.OZ.AU
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Cancel-Lock: sha1:BrPEewhtovHpK4TD7kAPjCoedKI=
X-Received: (from fjh@localhost)
	by mulga.cs.mu.OZ.AU (8.12.10+Sun/8.12.9/Submit) id jAS0DpMu012414;
	Mon, 28 Nov 2005 11:13:51 +1100 (EST)
X-Path: comp-std-cpp-robomod!not-for-mail
X-NNTP-Posting-Date: Sun, 27 Nov 2005 17:48:43 -0600
X-Delivered-To: std-c++@ucar.edu
X-TN-Interface: 209.99.127.20
X-Postfilter: 1.3.32
X-Authentication-Warning: serv1.gc.dca.giganews.com: news set sender to poster@giganews.com using -f
X-Newsgroups: comp.std.c++
Xref: g2news1.google.com comp.std.c++:2615

Ron Natalie <ron@spamcop.net> writes:

> David Abrahams wrote:
>
>> The other reason is backward compatibility.  Even when order of
>> evaluation is unpredictable, many lines of code have been written that
>> depend on a particular evaluation order -- the one that happened to be
>> chosen by the compiler.  If you force a specified evaluation order you
>> will break any such code that isn't already using the order
>> specified.  For many vendors, that kind of breakage induces
>> unacceptable friction with the customer base.
>
> That's spurious.  The code is already broken.

No, the code is nonportable.  It works in the context where it is
expected to.  It does no good for a vendor to respond with "fix your
code; it is broken" if the important customers say, "fine, we'll go
with someone else who can provide stability across versions."

> The compiler is free to pick a different ordering at whim.

Often it is not.  Compiler implementors constrain themselves beyond
what the standard specifies, in order to satisfy various customer
demands -- even unreasonable ones.  Often they constrain themselves in
ways that provide "guarantees" they won't document, such as stable
evaluation order.

> If you recompile the application, perhaps with a newer version of
> the compiler 

Unless the compiler implementor constrains himself to avoid changing
evaluation order.  That *does* happen.

> or a different compiler, or perhaps just a different set of compiler
> flags, the results will be different.

All possibly true.  It's also possible for customers to develop
expectations of behavior that isn't guaranteed by the standard or
documented by vendors (actually if you think hard about it I bet
you'll find you have some such expectations).  Vendors sometimes will
choose to meet those expectations in order to stay in business.


-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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



