From 6428459918385841276
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: f78e5,327d55d23ac807ba
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2004-04-15 13:00:01 PST
Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!kibo.news.demon.net!mutlu.news.demon.net!demon!mail2news.demon.co.uk!devnull
From: do-not-spam-benh@bwsint.com (Ben Hutchings)
Newsgroups: comp.std.c++
Subject: Re: atexit and/or objects with global storage duration
Date: Thu, 15 Apr 2004 19:59:59 +0000 (UTC)
Organization: ntl Cablemodem News Service
Lines: 28
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <slrnc7tmhs.gkv.do-not-spam-benh@shadbolt.i.decadentplace.org.uk>
References: <407E38E8.8020008@bdal.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: mail2news.demon.co.uk 1082059199 15260 10.0.0.1 (15 Apr 2004 19:59:59 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Thu, 15 Apr 2004 19:59:59 +0000 (UTC)
X-Received: from mulga.cs.mu.oz.au ([128.250.1.22])
	by news.demon.co.uk with esmtp (Exim 4.12)
	id 1BED1i-0003xz-00
	for mail2news@news.news.demon.net; Thu, 15 Apr 2004 19:59:58 +0000
X-Received: from mulga.cs.mu.OZ.AU (localhost [127.0.0.1]) by mulga.cs.mu.OZ.AU with ESMTP
	id i3FJxui2002148; Fri, 16 Apr 2004 05:59:56 +1000 (EST)
X-Received: (from fjh@localhost)
	by mulga.cs.mu.OZ.AU (8.12.10+Sun/8.12.9/Submit) id i3FJxtsT002138;
	Fri, 16 Apr 2004 05:59:55 +1000 (EST)
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Path: comp-std-cpp-robomod!not-for-mail
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-Delivered-To: std-c++@ucar.edu
X-Newsgroups: comp.std.c++
X-Reply-To: Ben Hutchings <benh@bwsint.com>
X-User-Agent: slrn/0.9.7.4 (Linux)
X-NNTP-Posting-Date: Thu, 15 Apr 2004 19:00:22 GMT
X-Spam-Level: 
X-Spam-Checker-Version: SpamAssassin 2.60-mulga_r1 (1.212-2003-09-23-exp) on 
	mulga.cs.mu.OZ.AU
X-Spam-Status: No, hits=0.0 required=5.2 tests=none autolearn=no 
	version=2.60-mulga_r1
X-MIME-Autoconverted: from 8bit to quoted-printable by mulga.cs.mu.OZ.AU id i3FJxui2002148
Xref: archiver1.google.com comp.std.c++:1672

"Daniel Kr=FCgler (nee Spangenberg)" wrote:
> Hello community,
>=20
> yesterday night I stumbled about a problem, for which I could not
> find an answer in the current C++ standard (2003).

See 18.3/8.  It's not easy to read, but it does cover this situation.
The 1998 standard did not (see
<http://std.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#3>).

<snip>=20
> Is this program wellformed or does it lead to undefined behaviour?
<snip>

You are confusing two different kinds of error.  If a program is not
well-formed, this error can and must be detected and reported at
compile time.  "Undefined behaviour" can only occur in situations
which the standard does not require implementors to detect.

Anyway, I believe your program is well-formed and does not have
undefined behaviour.

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



