220 14875 <CAALp5N7DFpphjOtsa_ykREt6h_WidTNYPrvrgTuJZGtxt=18bw@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: =?UTF-8?Q?Germ=C3=A1n_Diago?= <germandiago@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Safer C++: never allow implicitly uninitialized variables?
Date: Sat, 6 Dec 2014 13:13:31 +0700
Lines: 128
Approved: news@gmane.org
Message-ID: <CAALp5N7DFpphjOtsa_ykREt6h_WidTNYPrvrgTuJZGtxt=18bw@mail.gmail.com>
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: multipart/alternative; boundary=001a113d2eaee9df4b05098618f1
X-Trace: ger.gmane.org 1417846440 3670 80.91.229.3 (6 Dec 2014 06:14:00 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sat, 6 Dec 2014 06:14:00 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDC2VXM4YYDRBIF5RKSAKGQEYU5A4VQ@isocpp.org Sat Dec 06 07:13:54 2014
Return-path: <std-proposals+bncBDC2VXM4YYDRBIF5RKSAKGQEYU5A4VQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yh0-f69.google.com ([209.85.213.69])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDC2VXM4YYDRBIF5RKSAKGQEYU5A4VQ@isocpp.org>)
	id 1Xx8cr-0000AM-SL
	for gclcip-std-proposals@m.gmane.org; Sat, 06 Dec 2014 07:13:54 +0100
Original-Received: by mail-yh0-f69.google.com with SMTP id 29sf5375660yhl.8
        for <gclcip-std-proposals@m.gmane.org>; Fri, 05 Dec 2014 22:13:53 -0800 (PST)
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:from:date
         :message-id:subject:to: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=6FKWaNCZZcH3UhRSQprMdB8pfMQFj8HnxSUL3E3LNr4=;
        b=FZe4Ujbld9JGztCOoZWZz/c86rIqe25j6qYVSsUPnbTMq9yrPLgSelp7jdFCAZFzXn
         Sm5FBcjw2Jpj/ZEWbEJNfMmqmWN4Z0EXxLO9kgxGcAm49NjoktEY90Hu9giLF6nsU2iE
         cU++JRLXYtpZtGbE5H2OcXnCDOeWw51eEv1JAZp+uBALuG0XPwlSZum9mNHe7j9vf8ZI
         m4r2OltnjFBZwYKihJdxU4SE76XPKfE0eqjPgNrXf/B5+mYA6EquakdnIgqUBd8TAwNm
         C4PmUIq+iO48gLDqUs1qhclXoxCSM7JwXd+i2jXh2R6je9rf9GAh51Z12SF07UOwpr9f
         GCtA==
X-Gm-Message-State: ALoCoQlCuXWCuw/R5vAYqpl7BrA5Z6bZyNA/YjmYJCl9kkURxffhkq2Xtt1Q0T2puPocyzf6Vxa3
X-Received: by 10.236.39.83 with SMTP id c59mr18041067yhb.45.1417846432772;
        Fri, 05 Dec 2014 22:13:52 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.182.196.10 with SMTP id ii10ls698090obc.48.gmail; Fri, 05 Dec
 2014 22:13:51 -0800 (PST)
X-Received: by 10.202.137.139 with SMTP id l133mr576390oid.123.1417846431928;
        Fri, 05 Dec 2014 22:13:51 -0800 (PST)
Original-Received: from mail-oi0-x22f.google.com (mail-oi0-x22f.google.com. [2607:f8b0:4003:c06::22f])
        by mx.google.com with ESMTPS id w4si21177078oia.101.2014.12.05.22.13.51
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Fri, 05 Dec 2014 22:13:51 -0800 (PST)
Received-SPF: pass (google.com: domain of germandiago@gmail.com designates 2607:f8b0:4003:c06::22f as permitted sender) client-ip=2607:f8b0:4003:c06::22f;
Original-Received: by mail-oi0-f47.google.com with SMTP id v63so1437191oia.34
        for <std-proposals@isocpp.org>; Fri, 05 Dec 2014 22:13:51 -0800 (PST)
X-Received: by 10.202.216.11 with SMTP id p11mr633924oig.47.1417846431799;
 Fri, 05 Dec 2014 22:13:51 -0800 (PST)
Original-Received: by 10.182.162.6 with HTTP; Fri, 5 Dec 2014 22:13:31 -0800 (PST)
In-Reply-To: <4720a9a6-24d5-4488-a229-2bdf2433fa03@isocpp.org>
X-Original-Sender: germandiago@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of germandiago@gmail.com designates 2607:f8b0:4003:c06::22f as
 permitted sender) smtp.mail=germandiago@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:14875
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/14875>

--001a113d2eaee9df4b05098618f1
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

P.S.: sorry for the typos.

2014-12-06 13:10 GMT+07:00 Germ=C3=A1n Diago <germandiago@gmail.com>:

> Hello everyone,
>
> I wonder if it would make sense to make variables in C++ automatically
> value-initialized or there would be problems.
>
> Since we are making c++ safer and safer, would it make sense to do the
> following?
>
>
> int a; //value-initialized to 0
>
> Later, some syntax like in D language could be provided:
>
> int a =3D void;
>
>
> The rationale behind this change would be:
>
> - an uninitialized variable that is replaced by these new semantics does
> not produce incorrect behaviour.
> - makes the language safer to use.
>
> In the case where performance must be preserved, a compiler option with
> the old semantics would be enough.
>
> Would this make any sense or I am missing manu points? It looks to me tha=
t
> this could be backwards-compatible
> and the noly thing that could happen is a performance bug, which can be
> solved replacing iniitialization or by a
> compiler switch for large codebases.
>
>
>
>  --
>
> ---
> 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/.
>

--=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/.

--001a113d2eaee9df4b05098618f1
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">P.S.: sorry for the typos.</div><div class=3D"gmail_extra"=
><br><div class=3D"gmail_quote">2014-12-06 13:10 GMT+07:00 Germ=C3=A1n Diag=
o <span dir=3D"ltr">&lt;<a href=3D"mailto:germandiago@gmail.com" target=3D"=
_blank">germandiago@gmail.com</a>&gt;</span>:<br><blockquote class=3D"gmail=
_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:=
1ex"><div dir=3D"ltr">Hello everyone,<div><br></div><div>I wonder if it wou=
ld make sense to make variables in C++ automatically value-initialized or t=
here would be problems.</div><div><br></div><div>Since we are making c++ sa=
fer and safer, would it make sense to do the following?</div><div><br></div=
><div><br></div><div>int a; //value-initialized to 0</div><div><br></div><d=
iv>Later, some syntax like in D language could be provided:</div><div><br><=
/div><div>int a =3D void;</div><div><br></div><div><br></div><div>The ratio=
nale behind this change would be:</div><div><br></div><div>- an uninitializ=
ed variable that is replaced by these new semantics does not produce incorr=
ect behaviour.</div><div>- makes the language safer to use.</div><div><br><=
/div><div>In the case where performance must be preserved, a compiler optio=
n with the old semantics would be enough.</div><div><br></div><div>Would th=
is make any sense or I am missing manu points? It looks to me that this cou=
ld be backwards-compatible</div><div>and the noly thing that could happen i=
s a performance bug, which can be solved replacing iniitialization or by a<=
/div><div>compiler switch for large codebases.</div><span class=3D"HOEnZb">=
<font color=3D"#888888"><div><br></div><div><br></div><div><br></div></font=
></span></div><span class=3D"HOEnZb"><font color=3D"#888888">

<p></p>

-- <br>
<br>
--- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_=
blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/isocpp.org/gro=
up/std-proposals/</a>.<br>
</font></span></blockquote></div><br></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--001a113d2eaee9df4b05098618f1--

.
