From 4744781094904073123
X-Google-Thread: f78e5,e2cfdf64f67c7793
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news1.google.com!news1.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!peer01.cox.net!cox.net!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!stump.algebra.com!devnull
From: sean@f4.ca (Sean Kelly)
Newsgroups: comp.std.c++
Subject: Re: Eliminating uninitialised variables
Date: Fri, 24 Sep 2004 00:04:11 GMT
Organization: http://groups.google.com
Lines: 23
Sender: mail2news@demon.net
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <c628f43d.0409231543.397b1c09@posting.google.com>
References: <4150695d@andromeda.datanet.hu> <memo.20040922200512.2520C@brangdon.m> <aRm4d.348315$8_6.249357@attbi_s04>
NNTP-Posting-Host: news.news.demon.net
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: news.demon.co.uk 1095984259 6330 158.152.254.254 (24 Sep 2004 00:04:19 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Fri, 24 Sep 2004 00:04:19 +0000 (UTC)
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-Spam-Checker-Version: SpamAssassin 2.64-mulga_r1 (2004-01-11) on 
	mulga.cs.mu.OZ.AU
X-Spam-Status: No, hits=-4.9 required=5.0 tests=BAYES_00 autolearn=ham 
	version=2.64-mulga_r1
X-Received: (from fjh@localhost)
	by mulga.cs.mu.OZ.AU (8.12.10+Sun/8.12.9/Submit) id i8O04BiK001595;
	Fri, 24 Sep 2004 10:04:11 +1000 (EST)
X-Path: comp-std-cpp-robomod!not-for-mail
X-NNTP-Posting-Date: Thu, 23 Sep 2004 23:43:42 +0000 (UTC)
X-Delivered-To: std-c++@ucar.edu
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Newsgroups: comp.std.c++
Xref: g2news1.google.com comp.std.c++:2867

walter@digitalmars.nospamm.com ("Walter") wrote in message news:<aRm4d.348315$8_6.249357@attbi_s04>...
> 
> It's too bad there is no NaN pattern for integer types. Even better would be
> a memory bit per location that could be set to "uninitialized" which would
> cause a trap if that location was read. I wonder some times how many latent
> bugs of this nature are in shipping applications <g>.

The standard does leave room for trap values, though I haven't
encountered a compiler that uses them.  My only concern with having
C++ default initialize primitives to a NaN-like value is that it would
silently break a lot of code that relies on current default
constructor behavior (ie. set to zero).  Quite nice for D, but it may
be too late for C++.


Sean

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



