From 395883220815819280 X-Google-Thread: f78e5,174aa7b34b06a51 X-Google-Attributes: gidf78e5,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!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: SeeWebsiteForEmail@moderncppdesign.com ("Andrei Alexandrescu (See Website For Email)") Newsgroups: comp.std.c++ Subject: Re: Is this really unspecified behavior? Date: Tue, 20 Dec 2005 05:57:59 GMT Organization: Computer Science & Engineering, U of Washington, Seattle Lines: 63 Sender: mail2news@demon.net Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++) Message-ID: References: <1132759176.368850.264850@g43g2000cwa.googlegroups.com> <1132933832.802917.153350@g14g2000cwa.googlegroups.com> <1133551647.532929.325730@z14g2000cwz.googlegroups.com> <1133583412.951239.208510@g49g2000cwa.googlegroups.com> <1133910546.716987.80030@g14g2000cwa.googlegroups.com> <0l5ep1ppfhdj5p1pcu7e4na4ub0vjajlq3@4ax.com> So once you have more than one designer of something, it is all about > compromise. > > The aerodynamics people want thinner, smoother wings. The structural > guys want big thick wings shaped like I-beams. The fuel storage group > just wants to stick two gas tanks on either side of the fuselage. The > weight and balance group doesn't really even want the wings in the first > place. At the end of the day, it has to fly without falling apart or > crashing. Of course. I agree with all that, but IMHO with this one it's something more like, "Wings must be made of duraluminum because dural is better than all other materials." That's an assumption that can be invalidated by advance in materials. > The compiler experts are telling us that they need some freedom in this > area for optimization purposes. You see, this is what I'm not sure at all anymore. The two compiler experts that I know told me it's not a relevant source of optimization. So so far we're a few people just passing anecdotes and hearsay around, most of which is 20 years old. And even though this is comp.std.c++, not one person, expert or not, came with an example showing with numbers that the assumption I'm questioning is still valid. > (Some of the) exception safety experts > are saying too much freedom leads to error prone, fragile code. Having > grown up with C, personally I'm very use to the fact that: > > f(i, ++i); > > is not well defined. It is something I can live with, and over the > decades it has come to seem an acceptable fact of life despite the fact > that it might horrify a Java programmer. Honest, in the spirit of out-of-the-box thinking, we should still be horrified, particularly when (because?) it's gratuitous. > However, the fact that the pattern: > > f(acquire(release())); > > is safe, while the pattern: > > f(acquire(release()), do_something_unrelated()); > > isn't safe, I find scary even for C++ programmers. And the minimum > compromise we need to get this puppy off the ground is the sequence > point. Yah, point taken. Requiring a sequence point might actually be a very smart political-technical move :o). Andrei --- [ 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 ]