220 14929 <59113276.ZOeVMUBO6m@drako> article
Path: news.gmane.org!not-for-mail
From: "Ivan =?utf-8?B?xIx1a2nEhw==?=" <ivan.cukic@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Safer C++: never allow implicitly uninitialized variables?
Date: Wed, 10 Dec 2014 00:12:11 +0100
Organization: KDE
Lines: 30
Approved: news@gmane.org
Message-ID: <59113276.ZOeVMUBO6m@drako>
References: <4720a9a6-24d5-4488-a229-2bdf2433fa03@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 1418166919 18228 80.91.229.3 (9 Dec 2014 23:15:19 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 9 Dec 2014 23:15:19 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBD6M5NX6WAFRBAUFT2SAKGQE2Z74BAQ@isocpp.org Wed Dec 10 00:15:15 2014
Return-path: <std-proposals+bncBD6M5NX6WAFRBAUFT2SAKGQE2Z74BAQ@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+bncBD6M5NX6WAFRBAUFT2SAKGQE2Z74BAQ@isocpp.org>)
	id 1XyTzv-0003Nu-DH
	for gclcip-std-proposals@m.gmane.org; Wed, 10 Dec 2014 00:15:15 +0100
Original-Received: by mail-wi0-f198.google.com with SMTP id r20sf1468876wiv.1
        for <gclcip-std-proposals@m.gmane.org>; Tue, 09 Dec 2014 15:15:15 -0800 (PST)
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:organization
         :user-agent:in-reply-to:references:mime-version:content-type
         :x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=TU9bcstUGnbUCC8F3AEu7S/SbH/g3aSiGyC+KAnM09s=;
        b=hGEKbreL8QzT+EQdXd+XXxmEXVecBRqrG2ueFpzXoKkx4iDphb62K9Wig+xw8u0OJz
         sf+hNXK9j2GVXPjI7DZu/7+5ofYcGwDQl0CAUHU2X+yTbbRlxy9B7vwVDiO1Ok3oC986
         mcDhnBL2OG8SMhanWqmafMwr/QoaNzwQJZSH5QvPFUeq51FFjYxrU//82CIsA26SlvZ7
         7Iwlbx4KqA3b8EK5Xe1qBv6LBrxdyS3Q8esyOJrsxyIfjLq0vhAY3ABs2oBMN6adtsgp
         4m7znlAIEh6sKSAPtKcjymPpehChvmw16JPX2QTN9471Shqb8ZifvLQzsaJkDfehi2nh
         6ACA==
X-Gm-Message-State: ALoCoQmB2ZAvzLtLKUfD85lystYnOSy3ONDVBhhzbmhKK65SpE0KujSpX5kMCeHel/y0dhBKVdfw
X-Received: by 10.180.99.227 with SMTP id et3mr2065952wib.3.1418166915111;
        Tue, 09 Dec 2014 15:15:15 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.180.21.129 with SMTP id v1ls225421wie.38.gmail; Tue, 09 Dec
 2014 15:15:14 -0800 (PST)
X-Received: by 10.180.90.206 with SMTP id by14mr8176377wib.67.1418166914369;
        Tue, 09 Dec 2014 15:15:14 -0800 (PST)
Original-Received: from mail-wg0-x234.google.com (mail-wg0-x234.google.com. [2a00:1450:400c:c00::234])
        by mx.google.com with ESMTPS id fk10si17326996wib.26.2014.12.09.15.15.14
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Tue, 09 Dec 2014 15:15:14 -0800 (PST)
Received-SPF: pass (google.com: domain of ivan.cukic@gmail.com designates 2a00:1450:400c:c00::234 as permitted sender) client-ip=2a00:1450:400c:c00::234;
Original-Received: by mail-wg0-f52.google.com with SMTP id x12so2174585wgg.25
        for <std-proposals@isocpp.org>; Tue, 09 Dec 2014 15:15:14 -0800 (PST)
X-Received: by 10.180.37.142 with SMTP id y14mr1225476wij.47.1418166914252;
        Tue, 09 Dec 2014 15:15:14 -0800 (PST)
Original-Received: from drako.erebor.local (cable-178-148-120-90.dynamic.sbb.rs. [178.148.120.90])
        by mx.google.com with ESMTPSA id ry19sm3614819wjb.3.2014.12.09.15.15.13
        for <std-proposals@isocpp.org>
        (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Tue, 09 Dec 2014 15:15:13 -0800 (PST)
Original-Received: from drako.erebor.local (localhost [127.0.0.1])
	by drako.erebor.local (8.14.4/8.14.4/Debian-8) with ESMTP id sB9NCCrB023073
	for <std-proposals@isocpp.org>; Wed, 10 Dec 2014 00:12:12 +0100
Original-Received: (from ivan@localhost)
	by drako.erebor.local (8.14.4/8.14.4/Submit) id sB9NCBas023072
	for std-proposals@isocpp.org; Wed, 10 Dec 2014 00:12:11 +0100
X-Authentication-Warning: drako.erebor.local: ivan set sender to ivan.cukic@yandex.com using -f
User-Agent: KMail/4.72 pre (Linux/3.16.0-4-amd64; KDE/5.5.0; x86_64; ; )
In-Reply-To: <4720a9a6-24d5-4488-a229-2bdf2433fa03@isocpp.org>
X-Original-Sender: ivan.cukic@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of ivan.cukic@gmail.com designates 2a00:1450:400c:c00::234 as
 permitted sender) smtp.mail=ivan.cukic@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: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:14929
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/14929>


> I wonder if it would make sense to make variables in C++ automatically
> value-initialized or there would be problems.

Hi,

Another work-around which is beoming more popular lately is to use auto as the 
type specifier. In that case, you are forced to explicitely initialize the 
variable.

This is, IMO, safer than initializing it to a compiler-chosen value (or a 
default-constructed one).


--
Cheerio,
Ivan


KDE, ivan.cukic at kde.org, http://ivan.fomentgroup.org/
gpg key id: 850B6F76, keyserver.pgp.com

-- 

--- 
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/.

.
