From 5316168549880260036
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!news.zanker.org!news.clara.net!wagner.news.clara.net!194.159.246.34.MISMATCH!peer-uk.news.demon.net!kibo.news.demon.net!mutlu.news.demon.net!news.demon.co.uk!demon!stump.algebra.com!devnull
From: news0@nospam.demon.co.uk (John G Harris)
Newsgroups: comp.std.c++
Subject: Re: Eliminating uninitialised variables
Date: Wed, 22 Sep 2004 17:14:58 GMT
Organization: None
Lines: 28
Sender: mail2news@demon.net
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <1GKClHFePJUBFwoH@jgharris.demon.co.uk>
References: <memo.20040920104138.384A@brangdon.m>
NNTP-Posting-Host: news.news.demon.net
Mime-Version: 1.0
Content-Type: text/plain;charset=us-ascii
X-Trace: news.demon.co.uk 1095873303 29229 158.152.254.254 (22 Sep 2004 17:15:03 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Wed, 22 Sep 2004 17:15:03 +0000 (UTC)
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-User-Agent: Turnpike/6.03-S (<EGU7g$8ITKaftm754Gvj33Bcec>)
X-Spam-Checker-Version: SpamAssassin 2.64-mulga_r1 (2004-01-11) on 
	mulga.cs.mu.OZ.AU
X-Spam-Status: No, hits=-3.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham 
	version=2.64-mulga_r1
X-Reply-To: reply0@jgharris.demon.co.uk
X-Received: (from fjh@localhost)
	by mulga.cs.mu.OZ.AU (8.12.10+Sun/8.12.9/Submit) id i8MHEwHg014274;
	Thu, 23 Sep 2004 03:14:58 +1000 (EST)
X-Path: comp-std-cpp-robomod!not-for-mail
X-Spam-Level: 
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++:2828

In message <memo.20040920104138.384A@brangdon.m>, Dave Harris
<brangdon@cix.co.uk> writes

  <snip>
>What else am I missing? This is surely the kind of thing which future
>revisions of the C++ standard should be considering.

1 Are there any compilers that make a good job of warning about the use
of uninitialised variables? If there are then surely that's a better
solution.

2 Why is zero a better junk value than any other junk value?

3 Wouldn't it be simpler to say that all stack space and all heap space
is zeroed before (re-)use?

4 What about volatile?

  John
-- 
John Harris

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



