From owner-svn-src-head@freebsd.org Sat Feb 20 01:51:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27D3CAAEC19; Sat, 20 Feb 2016 01:51:42 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-yw0-f172.google.com (mail-yw0-f172.google.com [209.85.161.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E23351A4C; Sat, 20 Feb 2016 01:51:41 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-yw0-f172.google.com with SMTP id h129so81302830ywb.1; Fri, 19 Feb 2016 17:51:41 -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:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=tJMQB7ePCleKDnZEijcepFW7+kNigL4PZb4FjJwmmoI=; b=A0RMPyl4viU44qIi8ScstXBy6HsX+IJeGWZ1a1b0Gvx7NmiIT2mNP6m5qNbSS215Ep CK9UCJZpoxwkhkoLTZe1Nku76CDF2IgZxwheUZ0hBkXSfmW6h2WdBkOH7lD8kdw2m51R HDD0DAuOd+k3JP7bQYUP3T/OWoJ7iMAgkxY9+0hGvXd3vT9RuGbWvz1c+qkWxIjZHWMl 8qMo7tottSlxN9GsLFTEekCBZwMO5RgUcSC7j41rgDQsHvcInbnm2Kevmph6lkhnzmeF MivQpxAqvg6G/B1KIZw2baQyee8onmLmFtsE3dcH5B56ZyeNuCjnLM9LOnZYUBxPW8GP QpOw== X-Gm-Message-State: AG10YOTMONgwej1ybJ0mGHj2MawIu/euCSQeWpQAG/muaQ0YuJfbupiYHZie7mwrX5n1bg== X-Received: by 10.129.147.2 with SMTP id k2mr9362446ywg.69.1455929440719; Fri, 19 Feb 2016 16:50:40 -0800 (PST) Received: from mail-yw0-f169.google.com (mail-yw0-f169.google.com. [209.85.161.169]) by smtp.gmail.com with ESMTPSA id o23sm10644901ywd.30.2016.02.19.16.50.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Feb 2016 16:50:40 -0800 (PST) Received: by mail-yw0-f169.google.com with SMTP id e63so80367130ywc.3; Fri, 19 Feb 2016 16:50:40 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.13.212.195 with SMTP id w186mr9479851ywd.247.1455929440113; Fri, 19 Feb 2016 16:50:40 -0800 (PST) Reply-To: cem@FreeBSD.org Received: by 10.37.210.9 with HTTP; Fri, 19 Feb 2016 16:50:40 -0800 (PST) In-Reply-To: References: <201602182008.u1IK81vg092127@repo.freebsd.org> <20160219230612.GR1945@FreeBSD.org> Date: Fri, 19 Feb 2016 16:50:40 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r295768 - head/usr.sbin/iostat From: Conrad Meyer To: Benjamin Kaduk Cc: Gleb Smirnoff , Alan Somers , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Sergey Kandaurov , "src-committers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2016 01:51:42 -0000 On Fri, Feb 19, 2016 at 3:14 PM, Benjamin Kaduk wrote: > On Fri, Feb 19, 2016 at 5:06 PM, Gleb Smirnoff wrote: >> Isn't zero filling part of the standard? I don't see why lack of >> explicit zeroing is a warning? Looks a false warning to me. > > > It is not quite as simple as this would make it sound. The elements or > members of an aggregate (e.g.) structure type are initialized as if it were > an object of static storage duration (i.e., to zero) if the initializer list > does not contain enough initializers for all members of the aggregate type, > per item 21 of section 6.7.8 of n1256.pdf. However, such initialization > does not necessarily need to zero any padding bytes that are present, which > may take unspecified values. Personally, I think this particular clang > warning can be too aggressive, especially for complex structs, but on the > other hand given the indeterminateness of padding, bzero/memset are often a > better choice anyway. By definition, padding byte contents are unused. There is no reason their values matter one way or another, so why do we care about the distinction between bzero and member zero initialization? Best, Conrad