220 11512 <CAA+UVZT8wNh5Y-gUme3_SPqMOatyy5-6+FG284a7FTZNfrCY-g@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Lawrence Crowl <Lawrence@Crowl.org>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Controversy and debate: Uninitialized variables
 by default is a bug
Date: Wed, 18 Jun 2014 13:36:26 -0700
Lines: 29
Approved: news@gmane.org
Message-ID: <CAA+UVZT8wNh5Y-gUme3_SPqMOatyy5-6+FG284a7FTZNfrCY-g@mail.gmail.com>
References: <60caa4ef-b32d-40fe-97b6-8918fbb2bd51@isocpp.org>
	<CAGg_6+Ossg1SPRDSw5qnHR4ZW8NrgT4W8z7uHLAgD7mvfh-wtQ@mail.gmail.com>
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 1403123796 3912 80.91.229.3 (18 Jun 2014 20:36:36 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 18 Jun 2014 20:36:36 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBC2NJ44B2QNBBS7QQ6OQKGQEYPABFKI@isocpp.org Wed Jun 18 22:36:29 2014
Return-path: <std-proposals+bncBC2NJ44B2QNBBS7QQ6OQKGQEYPABFKI@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+bncBC2NJ44B2QNBBS7QQ6OQKGQEYPABFKI@isocpp.org>)
	id 1WxMar-0006lq-5t
	for gclcip-std-proposals@m.gmane.org; Wed, 18 Jun 2014 22:36:29 +0200
Original-Received: by mail-wi0-f198.google.com with SMTP id r20sf1022730wiv.9
        for <gclcip-std-proposals@m.gmane.org>; Wed, 18 Jun 2014 13:36:28 -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:sender: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=PQj7xSnicdxzA+tVoMt0rh3owkA/hOftCtZwRJR2Xkc=;
        b=aSuU3Hbg2D4+vO5hISQ5j27f9MFRmfrqzFXWK9/WQ/KukklsntYwTIbiWcpFcNikoT
         ZQLJgfA1FUlk7dU9Dn82hzSq+WDEnrSBAa+Nn+f383E0CJ2ohDRzAhjp7lcuOtGlHyCC
         cig0PYFv79IV1yhF1YqtW4E345awe1TaI3QRLw818I2znKGEGnB/fwOHfd6XPpJQCYD3
         W/qe8fTSsTGERHSqstaG2+veGfrTNCPK34n/CeOWujl4G7htNQn/36BPKgYlLiQatC+f
         tP/xOCa1xGqj68R9QTlugoXfnz4tX/alnv/8TJFosbXI5grxg8Nq3ZNoYqx6h89QIXeJ
         z36g==
X-Gm-Message-State: ALoCoQmO1LXBf7IZujcIslqjz9GQQbdDPnxF1amkRz9fZs14NMvSHAF+L0iRknCXf1dpBMhllEA5
X-Received: by 10.112.200.164 with SMTP id jt4mr47321lbc.14.1403123788771;
        Wed, 18 Jun 2014 13:36:28 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.180.98.7 with SMTP id ee7ls122743wib.22.gmail; Wed, 18 Jun
 2014 13:36:27 -0700 (PDT)
X-Received: by 10.194.58.199 with SMTP id t7mr580718wjq.14.1403123787551;
        Wed, 18 Jun 2014 13:36:27 -0700 (PDT)
Original-Received: from mail-wi0-x232.google.com (mail-wi0-x232.google.com [2a00:1450:400c:c05::232])
        by mx.google.com with ESMTPS id df8si4566597wjc.1.2014.06.18.13.36.27
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Wed, 18 Jun 2014 13:36:27 -0700 (PDT)
Received-SPF: pass (google.com: domain of lawrence.crowl@gmail.com designates 2a00:1450:400c:c05::232 as permitted sender) client-ip=2a00:1450:400c:c05::232;
Original-Received: by mail-wi0-f178.google.com with SMTP id n15so1790578wiw.17
        for <std-proposals@isocpp.org>; Wed, 18 Jun 2014 13:36:27 -0700 (PDT)
X-Received: by 10.194.142.205 with SMTP id ry13mr338229wjb.69.1403123787197;
 Wed, 18 Jun 2014 13:36:27 -0700 (PDT)
Original-Sender: lawrence.crowl@gmail.com
Original-Received: by 10.194.56.201 with HTTP; Wed, 18 Jun 2014 13:36:26 -0700 (PDT)
In-Reply-To: <CAGg_6+Ossg1SPRDSw5qnHR4ZW8NrgT4W8z7uHLAgD7mvfh-wtQ@mail.gmail.com>
X-Original-Sender: lawrence@crowl.org
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of lawrence.crowl@gmail.com designates 2a00:1450:400c:c05::232 as
 permitted sender) smtp.mail=lawrence.crowl@gmail.com;       dkim=pass header.i=@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:11512
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/11512>

On 6/17/14, Nevin Liber <nevin@eviloverlord.com> wrote:
> On 17 June 2014 17:49, Matthew Fioravante <fmatthew5876@gmail.com> wrote:
>> Please now, convince if you can why this is a bad idea.
>>
>
> Because IMO the correct answer is that the default should be for requiring
> users to explicitly initialize the variable, and have a way to mark it the
> few times they want an uninitialized variable.  All initializing to zero
> does is move the problem from something that static analyzers can catch to
> something they can't.

Emphasized.

If every declaration or expression has a fully-defined behavior, then, to
the compiler/runtime, no program can be wrong.  Undefined behavior is your
friend.  It means that your program can be detectably wrong.  It helps
compilers help you find bugs.

-- 
Lawrence Crowl

-- 

--- 
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/.

.
