220 11491 <5c9d83ad-b2ba-4b4f-8344-f2a1755ef98d@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Matthew Fioravante <fmatthew5876@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 09:24:29 -0700 (PDT)
Lines: 134
Approved: news@gmane.org
Message-ID: <5c9d83ad-b2ba-4b4f-8344-f2a1755ef98d@isocpp.org>
References: <60caa4ef-b32d-40fe-97b6-8918fbb2bd51@isocpp.org>
 <CAFk2RUYuHAmfzOR8CB_f6kgwPSnd7=sHP=qDy3pMO98cfbqcLA@mail.gmail.com>
 <0c70b26d-9af9-498d-b27f-37cf7afe9655@isocpp.org>
 <CAFk2RUboZxZxoBWZqLJ+phWNiQTqRrGx_-Us8g7TPTy3Xq6FrQ@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_419_15585578.1403022269665"
X-Trace: ger.gmane.org 1403022280 27713 80.91.229.3 (17 Jun 2014 16:24:40 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 17 Jun 2014 16:24:40 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDELF54RTIGRBPWXQGOQKGQEWIM2YXY@isocpp.org Tue Jun 17 18:24:34 2014
Return-path: <std-proposals+bncBDELF54RTIGRBPWXQGOQKGQEWIM2YXY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ie0-f199.google.com ([209.85.223.199])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDELF54RTIGRBPWXQGOQKGQEWIM2YXY@isocpp.org>)
	id 1WwwBU-0007TI-8H
	for gclcip-std-proposals@m.gmane.org; Tue, 17 Jun 2014 18:24:32 +0200
Original-Received: by mail-ie0-f199.google.com with SMTP id rd18sf43132721iec.10
        for <gclcip-std-proposals@m.gmane.org>; Tue, 17 Jun 2014 09:24:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe
         :content-type;
        bh=+Xdxg57h/F2Cx9rqRdnf1EMXJhLzGe7Dp0jPjCFn860=;
        b=mAqsgAXIQCuD1SVMSFN84/GSnumeRuqvtmIxB2eaco/0WKpUM+ZXZSa8wqWZMSaZgS
         AatfFkSgAHYA4biuJHwEDluyT3NEXGGmVsTgVHrqxqvhzVKnTubaYYfNTfhfZ850O0ax
         ESj44aNcyFGzgcn1+RH7o5nrKpNmq2QyXFOCl3oRv5s344gr3IhbP9eomwzWVcJySIBs
         Dyf39lEowPuk+BwB0643LO02NIcr4tzI3gfO5Mr6c0So3HfijfeaBNxRl0e9iwoyb2IH
         0pw2+OlgABvQ6TrEv/XLq4ZMJ3FUHMV5TXBxLxjr3lnOC62wxVuCDR4UgM/Dq7HjYER8
         r0iw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:to:message-id:in-reply-to:references
         :subject:mime-version:x-original-sender:reply-to:precedence
         :mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe:content-type;
        bh=+Xdxg57h/F2Cx9rqRdnf1EMXJhLzGe7Dp0jPjCFn860=;
        b=Jn5p4QkcLmM80/DhmUUHlDL3NBO+3gg0Uir+iK73D345VPjwljFnvL+8LLw4Rrp6tq
         swE05LnVIW4a4uQyuw18bY59cgYklBn9WwkVbDdk/jp9Idzvc5LKVX55TRLmWYvoFNPa
         voheA9hA48RQIYnR/hEBlUM/Ld2gXX2WanKy/xBdR6Ov0GdrPkxURoBVaA0wcsH3p6+I
         8HhyEVTcUMoCiFagUwRsB66aE/1rg1qnJDt4i0UuTgsTXmhqLqIEHDhLGmcuAVKWWq9/
         XX6TTcaXbcYdyAivZ4q8Azge1jbQZPzA6nehqRt67c9m2SBqkxrdXUH34YD50xoLPkWB
         Qb1Q==
X-Gm-Message-State: ALoCoQmhV4a3nujYzM7dYvuUOOdmtckHGCU2efkqNHV+nVxw/oIsZpQebkMGOg+sZzGdZuiMsgwL
X-Received: by 10.42.36.10 with SMTP id s10mr685217icd.5.1403022271102;
        Tue, 17 Jun 2014 09:24:31 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.26.40 with SMTP id 37ls230167qgu.23.gmail; Tue, 17 Jun
 2014 09:24:30 -0700 (PDT)
X-Received: by 10.140.108.162 with SMTP id j31mr53961qgf.18.1403022270513;
        Tue, 17 Jun 2014 09:24:30 -0700 (PDT)
In-Reply-To: <CAFk2RUboZxZxoBWZqLJ+phWNiQTqRrGx_-Us8g7TPTy3Xq6FrQ@mail.gmail.com>
X-Original-Sender: fmatthew5876@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:11491
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/11491>

------=_Part_419_15585578.1403022269665
Content-Type: text/plain; charset=UTF-8



On Tuesday, June 17, 2014 12:09:18 PM UTC-4, Ville Voutilainen wrote:
>
> On 17 June 2014 19:07, Matthew Fioravante <fmatth...@gmail.com 
> <javascript:>> wrote: 
> >> char buf[MEGABYTE]; 
> > Arrays are not an exception. 
> > If buf[MEGABYTE] is a global, its already initialized to 0. 
> > If its a class member or on the stack, you can say 
> > char buf[MEGABYTE] = void; 
> > to skip initialization. Otherwise it gets filled with 0s. 
>
> Yeah. And this sort of a difference to existing code has killed this idea 
> EVERY TIME. 
>

Why not write a conversion tool to check for instances of this?

On Tuesday, June 17, 2014 12:13:33 PM UTC-4, Nevin ":-)" Liber wrote:
>
> On 17 June 2014 18:09, Matthew Fioravante <fmatth...@gmail.com> wrote:
>
>>  After this idea it will still do the same thing. Not sure how a 
>> benchmark is needed for that.
>>
>
> You've made a bold, unsubstantiated claim this has no performance 
> implications, and hand wave away anyone who disagrees.  This is a question 
> that data quite easily answer, and anyone making performance claims ought 
> to have it.
>

The 2 things we are discussing (initializing aggregates by default vs 
standard library container initialization behavior) are orthogonal. Do you 
test the performance of std::map every time you write a file parsing 
routine? 

Ville's point about buf[MEGABYTE] is valid. There are real performance 
implications there because the behavior changes with arrays.

Standard library containers do not behave any differently, they always 
initialize their contents by default as they were designed to do in the 
beginning.
 

> -- 
>  Nevin ":-)" Liber  <mailto:ne...@eviloverlord.com>  (847) 691-1404 
>

-- 

--- 
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/.

------=_Part_419_15585578.1403022269665
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Tuesday, June 17, 2014 12:09:18 PM UTC-4, Ville=
 Voutilainen wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;mar=
gin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">On 17 June =
2014 19:07, Matthew Fioravante &lt;<a href=3D"javascript:" target=3D"_blank=
" gdf-obfuscated-mailto=3D"dS3XOtO8nM0J" onmousedown=3D"this.href=3D'javasc=
ript:';return true;" onclick=3D"this.href=3D'javascript:';return true;">fma=
tth...@gmail.com</a>&gt; wrote:
<br>&gt;&gt; char buf[MEGABYTE];
<br>&gt; Arrays are not an exception.
<br>&gt; If buf[MEGABYTE] is a global, its already initialized to 0.
<br>&gt; If its a class member or on the stack, you can say
<br>&gt; char buf[MEGABYTE] =3D void;
<br>&gt; to skip initialization. Otherwise it gets filled with 0s.
<br>
<br>Yeah. And this sort of a difference to existing code has killed this id=
ea
<br>EVERY TIME.
<br></blockquote><div><br>Why not write a conversion tool to check for inst=
ances of this?<br><br>On Tuesday, June 17, 2014 12:13:33 PM UTC-4, Nevin ":=
-)" Liber wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin=
-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"lt=
r">On 17 June 2014 18:09, Matthew Fioravante <span dir=3D"ltr">&lt;<a targe=
t=3D"_blank">fmatth...@gmail.com</a>&gt;</span> wrote:<br><div><div class=
=3D"gmail_quote">

<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr">&nbsp;After this idea it wi=
ll still do the same thing. Not sure how a benchmark is needed for that.</d=
iv></blockquote>

<div><br></div><div>You've made a bold, unsubstantiated claim this has=20
no performance implications, and hand wave away anyone who disagrees.=20
&nbsp;This is a question that data quite easily answer, and anyone making=
=20
performance claims ought to have it.</div></div></div></div></blockquote><d=
iv><br>The 2 things we are discussing (initializing aggregates by default v=
s standard library container initialization behavior) are orthogonal. Do yo=
u test the performance of std::map every time you write a file parsing rout=
ine? <br><br>Ville's point about buf[MEGABYTE] is valid. There are real per=
formance implications there because the behavior changes with arrays.<br><b=
r>Standard library containers do not behave any differently, they always in=
itialize their contents by default as they were designed to do in the begin=
ning.<br>&nbsp;</div><blockquote class=3D"gmail_quote" style=3D"margin: 0;m=
argin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=
=3D"ltr"><div><div class=3D"gmail_quote">

</div>-- <br>&nbsp;Nevin ":-)" Liber&nbsp; &lt;mailto:<a target=3D"_blank">=
ne...@eviloverlord.com</a><wbr>&gt;&nbsp; (847) 691-1404
</div></div>
</blockquote><br></div></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 />

------=_Part_419_15585578.1403022269665--

.
