220 11480 <CAFk2RUYuHAmfzOR8CB_f6kgwPSnd7=sHP=qDy3pMO98cfbqcLA@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Ville Voutilainen <ville.voutilainen@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Controversy and debate: Uninitialized variables
 by default is a bug
Date: Tue, 17 Jun 2014 18:58:10 +0300
Lines: 45
Approved: news@gmane.org
Message-ID: <CAFk2RUYuHAmfzOR8CB_f6kgwPSnd7=sHP=qDy3pMO98cfbqcLA@mail.gmail.com>
References: <60caa4ef-b32d-40fe-97b6-8918fbb2bd51@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
X-Trace: ger.gmane.org 1403020701 6641 80.91.229.3 (17 Jun 2014 15:58:21 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 17 Jun 2014 15:58:21 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBC5JHI7A7ALRBEWLQGOQKGQEHGX43SA@isocpp.org Tue Jun 17 17:58:14 2014
Return-path: <std-proposals+bncBC5JHI7A7ALRBEWLQGOQKGQEHGX43SA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-vc0-f198.google.com ([209.85.220.198])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBC5JHI7A7ALRBEWLQGOQKGQEHGX43SA@isocpp.org>)
	id 1Wwvm0-0008UB-62
	for gclcip-std-proposals@m.gmane.org; Tue, 17 Jun 2014 17:58:12 +0200
Original-Received: by mail-vc0-f198.google.com with SMTP id hy10sf25672125vcb.5
        for <gclcip-std-proposals@m.gmane.org>; Tue, 17 Jun 2014 08:58:11 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:in-reply-to:references:date
         :message-id:subject:from:to: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-type;
        bh=WffFuPBd2r3S3TThgdoavGgCK79zs8XHmlhEg4bNqPg=;
        b=HuUDB1VDuMPdSqDE1UxMQGH5OpZs3U8L5sz1NVGeaf5XK+w/56NLSLU14FIgV7agSP
         xkk52piatKnSImAuhSDl4dF47lcTRc5pQJSL9YXGYBrCpYK5rW/MNz4qX2xYCnlcVlUB
         dUSOzuTHSWuijMhpMV9Uti/MC/1DY+A0VNIvaJkOcGq65dhG5KlFkbOfhkXMJb4Lmn6i
         /Zne3pZWw8SfuB05qKtL1Sr4RUyrPvjq/fKpVn2XXmYrveetHXR33xWPUiMlOW8IP+M/
         KE0izmV+8sXH5WBhVqWE8bO0qmdMEKaKIMnLa9M4V5WjgA80Dt3/4WREe8VZBNb5pQOM
         BP0Q==
X-Gm-Message-State: ALoCoQl0rD4/hSnl5SCBrQ+XjGanHkgglaEttInM8K2fBkoM4MXv5in2G051fgeOM2Zfej0p4rrE
X-Received: by 10.236.26.105 with SMTP id b69mr413946yha.55.1403020691356;
        Tue, 17 Jun 2014 08:58:11 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.91.201 with SMTP id z67ls5172345qgd.94.gmail; Tue, 17 Jun
 2014 08:58:10 -0700 (PDT)
X-Received: by 10.224.127.10 with SMTP id e10mr38192026qas.64.1403020690780;
        Tue, 17 Jun 2014 08:58:10 -0700 (PDT)
Original-Received: from mail-qc0-x230.google.com (mail-qc0-x230.google.com [2607:f8b0:400d:c01::230])
        by mx.google.com with ESMTPS id y10si17454070qaj.18.2014.06.17.08.58.10
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Tue, 17 Jun 2014 08:58:10 -0700 (PDT)
Received-SPF: pass (google.com: domain of ville.voutilainen@gmail.com designates 2607:f8b0:400d:c01::230 as permitted sender) client-ip=2607:f8b0:400d:c01::230;
Original-Received: by mail-qc0-f176.google.com with SMTP id w7so8969143qcr.21
        for <std-proposals@isocpp.org>; Tue, 17 Jun 2014 08:58:10 -0700 (PDT)
X-Received: by 10.229.70.196 with SMTP id e4mr37637751qcj.16.1403020690679;
 Tue, 17 Jun 2014 08:58:10 -0700 (PDT)
Original-Received: by 10.224.183.199 with HTTP; Tue, 17 Jun 2014 08:58:10 -0700 (PDT)
In-Reply-To: <60caa4ef-b32d-40fe-97b6-8918fbb2bd51@isocpp.org>
X-Original-Sender: ville.voutilainen@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of ville.voutilainen@gmail.com designates 2607:f8b0:400d:c01::230 as
 permitted sender) smtp.mail=ville.voutilainen@gmail.com;       dkim=pass
 header.i=@gmail.com;       dmarc=pass (p=NONE dis=NONE) header.from=gmail.com
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:11480
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/11480>

On 17 June 2014 18:49, Matthew Fioravante <fmatthew5876@gmail.com> wrote:
> This is going to be controversial, but lets get into it.
>
> The fact that `int x;` creates an uninitialized integer instead of a default
> initialized one is completely wrong. I consider it a major defect in the
> language, a bug in the standard.

Well, it's not a bug by any definition that the committee uses, since we know
about it, and it's 100% intentional.

> Please now, convince if you can why this is a bad idea. Why should we


char buf[MEGABYTE];

buf[HERE] = something;
buf[THERE] = something_else;

According to what you propose, the mere definition of buf would go
through all of that
megabyte and zero-initialize the chars.

Or perhaps you meant that arrays are an exception? What about

struct X { char buf[MEGABYTE]; };

X x;

Is this also an exception to the rule?

How many performance expectations of how much existing code do you think this
change would break?

The committee's answer to this question has always been "too many, too
much", and
I don't see that changing.

-- 

--- 
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 email 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-proposals/.

.
