220 11505 <1798793.WG2J7LSt36@tjmaciei-mobl4> article
Path: news.gmane.org!not-for-mail
From: Thiago Macieira <thiago@macieira.org>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Controversy and debate: Uninitialized
 variables by default is a bug
Date: Tue, 17 Jun 2014 20:17:36 -0700
Lines: 42
Approved: news@gmane.org
Message-ID: <1798793.WG2J7LSt36@tjmaciei-mobl4>
References: <60caa4ef-b32d-40fe-97b6-8918fbb2bd51@isocpp.org> <03f935ac-2f51-46bb-b84b-d37c864e3b04@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: ger.gmane.org 1403061468 2023 80.91.229.3 (18 Jun 2014 03:17:48 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 18 Jun 2014 03:17:48 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCB4TK757YBRBVMJQSOQKGQEQNOGE2A@isocpp.org Wed Jun 18 05:17:44 2014
Return-path: <std-proposals+bncBCB4TK757YBRBVMJQSOQKGQEQNOGE2A@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wi0-f198.google.com ([209.85.212.198])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCB4TK757YBRBVMJQSOQKGQEQNOGE2A@isocpp.org>)
	id 1Wx6Na-0003Y1-HL
	for gclcip-std-proposals@m.gmane.org; Wed, 18 Jun 2014 05:17:42 +0200
Original-Received: by mail-wi0-f198.google.com with SMTP id r20sf211416wiv.9
        for <gclcip-std-proposals@m.gmane.org>; Tue, 17 Jun 2014 20:17:42 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:from:to:subject:date:message-id:user-agent
         :in-reply-to:references:mime-version:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe:content-transfer-encoding:content-type;
        bh=vlQEfJKmm/N99XhAbMNSwW+vYKMXle8m+uIwywfzNsc=;
        b=QxgNchCodMFlxVoRliWaOtyTXmDfUhlaPisuQBsxGzwGJc+f8Cf51BicqyvKliYE32
         +hXWgCZqXYWNQ42eZiw3+2Dmlo3oqNcDohQx5HQuniD0TSlxXdtRL4d3hfy4KRctE0yP
         bAeZJN5hh/eqIg6YZzkTmfHK2aPFMCvyyYKtsM166m9Tz4SqxsUdFMPWPv5zbw5m8xEY
         hwDtg6lxAoENdyPoJ7B0xImzy7/CJFUIx9IjjrQsEYD6fz0J2Jo1A6Yn+d8KSLr3UbUm
         rSFTUhUGb0M8MZBPqgY3ozjSUpz08mpAavBXQgbintIMjI9gDmG415aZpj6LB1nEa99D
         KKM 
X-Gm-Message-State: ALoCoQnl/auogjbdbx5RW1Uv5f0E4rRbFAECiZrbjSuYvyUSgrzf0liD9bs/UgPI4oiDTxsU0ZNp
X-Received: by 10.180.91.73 with SMTP id cc9mr71338wib.4.1403061462275;
        Tue, 17 Jun 2014 20:17:42 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.180.23.105 with SMTP id l9ls518295wif.3.gmail; Tue, 17 Jun
 2014 20:17:41 -0700 (PDT)
X-Received: by 10.194.89.168 with SMTP id bp8mr27007155wjb.73.1403061461164;
        Tue, 17 Jun 2014 20:17:41 -0700 (PDT)
Original-Received: from gondolin.macieira.info (gondolin.macieira.info. [2a01:4f8:d13:f81:21c:14ff:fe01:12a3])
        by mx.google.com with ESMTP id lh2si708153wjc.142.2014.06.17.20.17.40
        for <std-proposals@isocpp.org>;
        Tue, 17 Jun 2014 20:17:40 -0700 (PDT)
Received-SPF: pass (google.com: domain of thiago@macieira.org designates 2a01:4f8:d13:f81:21c:14ff:fe01:12a3 as permitted sender) client-ip=2a01:4f8:d13:f81:21c:14ff:fe01:12a3;
Original-Received: from tjmaciei-mobl4.localnet (unknown [IPv6:2601:7:1c80:c86:2c03:2902:6742:775c])
	by gondolin.macieira.info (Postfix) with ESMTPSA id 039A911A5C8
	for <std-proposals@isocpp.org>; Tue, 17 Jun 2014 20:17:40 -0700 (PDT)
User-Agent: KMail/4.13 (Linux/3.11.10-11-desktop; KDE/4.13.0; x86_64; ; )
In-Reply-To: <03f935ac-2f51-46bb-b84b-d37c864e3b04@isocpp.org>
X-Original-Sender: thiago@macieira.org
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of thiago@macieira.org designates 2a01:4f8:d13:f81:21c:14ff:fe01:12a3
 as permitted sender) smtp.mail=thiago@macieira.org
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:11505
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/11505>

Em ter 17 jun 2014, =E0s 18:39:25, rouslankorneychuk@gmail.com escreveu:
> I don't see how default initialization will actually prevent any bugs. If=
 a
> program reads a variable sooner than intended, or if the variable was not
> assigned a value when it was intended, your program still does the wrong
> thing regardless of whether the variable was initialized. The only
> difference is the program behaves more predictably and therefore easier t=
o
> debug, but you can get the same predictability by compiling in debug mode=
..

I actually dispute that it's easier to debug.

If you use a memory debugger like Valgrind, it will be able to point out=20
exactly where an uninitialised variable was used when it was uninitialised.=
 If=20
it happens to be initialised to zero, Valgrind can't tell intention.

That's the same reason why you should not reset pointers to null in=20
destructors.

> This might even make certain bugs harder to find because a program that
> would otherwise seemingly fail at random might not exhibit any symptoms
> until it is run under a very specific set of conditions.

--=20
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

.
