From 8084164235464951265
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!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!stump.algebra.com!devnull
From: rmaddox@isicns.com (Randy Maddox)
Newsgroups: comp.std.c++
Subject: Re: Eliminating uninitialised variables
Date: Fri, 24 Sep 2004 16:49:21 GMT
Organization: http://groups.google.com
Lines: 33
Sender: mail2news@demon.net
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <8c8b368d.0409240549.7c0ee626@posting.google.com>
References: <memo.20040920104138.384A@brangdon.m>
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 1096044565 25319 158.152.254.254 (24 Sep 2004 16:49:25 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Fri, 24 Sep 2004 16:49:25 +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=-3.3 required=5.0 tests=AWL,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 i8OGnL7A014823;
	Sat, 25 Sep 2004 02:49:21 +1000 (EST)
X-Path: comp-std-cpp-robomod!not-for-mail
X-NNTP-Posting-Date: Fri, 24 Sep 2004 13:49:17 +0000 (UTC)
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++:2870

brangdon@cix.co.uk (Dave Harris) wrote in message news:<memo.20040920104138.384A@brangdon.m>...
> In a comp.lang.c++.moderated thread about const correctness, the issue of 
> uninitialised variables came up. Accessing an uninitialised variable is a  
> source of undefined behaviour which requires constant programmer vigilance 
> to avoid. A mistake often leads to real bugs or crashes, which can be 
> irreproducible and so hard to track down.
> 
> Can we do something constructive towards fixing this? Has it been tried; 
> are there known problems? Here are my initial thoughts.
> 

    [snip]

Do we even need to do anything about this?  As other posters have
pointed out there are situations in which uninitialized variables are
normal, expected and not a problem.  Also, don't most compilers do a
good job of warning about uninitialized variables, if the warning
level is set high enough at least?  Once the compiler warns it's up to
the developer to decide if it is a problem or not and take corrective
action if and as necessary.  Do we really need anything more than
that?

Randy.

> 
> -- Dave Harris, Nottingham, UK

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



