From owner-svn-src-all@freebsd.org Fri Feb 19 23:23:52 2016 Return-Path: Delivered-To: svn-src-all@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 ECC53AAEE31; Fri, 19 Feb 2016 23:23:52 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B363E1C59; Fri, 19 Feb 2016 23:23:52 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:7b8:3a7::f94f:f974:728d:e162] (unknown [IPv6:2001:7b8:3a7:0:f94f:f974:728d:e162]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 83CE8AB5B; Sat, 20 Feb 2016 00:23:49 +0100 (CET) Subject: Re: svn commit: r295768 - head/usr.sbin/iostat Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Content-Type: multipart/signed; boundary="Apple-Mail=_238E574B-3F5B-481A-9AB3-C2137EB2BD81"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.6b2 (ebbf3ef) From: Dimitry Andric In-Reply-To: Date: Sat, 20 Feb 2016 00:23:40 +0100 Cc: Sergey Kandaurov , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: <83BB8467-4C40-4CF1-B394-1376C9D97FCF@FreeBSD.org> References: <201602182008.u1IK81vg092127@repo.freebsd.org> To: Alan Somers X-Mailer: Apple Mail (2.3112) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2016 23:23:53 -0000 --Apple-Mail=_238E574B-3F5B-481A-9AB3-C2137EB2BD81 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 19 Feb 2016, at 16:49, Alan Somers wrote: >=20 > On Fri, Feb 19, 2016 at 5:24 AM, Sergey Kandaurov = wrote: ... >>> -struct nlist namelist[] =3D { >>> +static struct nlist namelist[] =3D { >>> #define X_TTY_NIN 0 >>> - { "_tty_nin" }, >>> + { .n_name =3D "_tty_nin", >>> + .n_type =3D 0, .n_other =3D 0, .n_desc =3D 0, .n_value =3D = 0 }, >>> [...] >>=20 >> You unlikely need this excessive explicit zeroization. >> In this case it is implicitly prezeroed. ... > Yeah, it was being implicitly zeroized before. But Clang complained > about the structures being only partially initialized. Since the > whole point of my commit was to increase the WARNS level, I explicitly > zeroed the zero fields to silence Clang. You got this warning, most likely: usr.sbin/iostat/iostat.c:122:15: error: missing field 'n_type' = initializer [-Werror,-Wmissing-field-initializers] { "_tty_nin" }, ^ This warning is only produced when you use -Wall -W, and then initialize structs partially, i.e. you initialize some fields but not others. I think this is a quite reasonable warning for a high warning level. On the other hand, if this kind of construct is used throughout the tree, and it is not seen as a big problem, we can simply silence this particular warning using -Wno-missing-field -initializers. There is already quite a list of warnings which are suppressed by default, even at WARNS=3D6, namely: -Wno-empty-body -Wno-format-y2k -Wno-pointer-sign -Wno-string-plus-int -Wno-unused-const-variable -Wno-unused-parameter -Dimitry --Apple-Mail=_238E574B-3F5B-481A-9AB3-C2137EB2BD81 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.29 iEYEARECAAYFAlbHpAUACgkQsF6jCi4glqMxlQCg/fTaWwEfvIldNSVMJDEjxMbV xD0AoI7Hez0QV3G6p9UhX8FsRzU/eYZJ =fJ6B -----END PGP SIGNATURE----- --Apple-Mail=_238E574B-3F5B-481A-9AB3-C2137EB2BD81--