From owner-svn-src-all@freebsd.org Sun Dec 13 09:13:22 2015 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 A00AFA41BFD; Sun, 13 Dec 2015 09:13:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (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 630CD18AD; Sun, 13 Dec 2015 09:13:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:7b8:3a7::6514:f4:a390:3c16] (unknown [IPv6:2001:7b8:3a7:0:6514:f4:a390:3c16]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 409FF1C644; Sun, 13 Dec 2015 10:13:13 +0100 (CET) Subject: Re: svn commit: r292120 - in head/contrib/elftoolchain: addr2line common elfcopy libelf readelf Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Content-Type: multipart/signed; boundary="Apple-Mail=_91055249-97B0-46CB-ADBA-5F29D2DB48BD"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.6b2 From: Dimitry Andric In-Reply-To: Date: Sun, 13 Dec 2015 10:13:06 +0100 Cc: Adrian Chadd , Ed Maste , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Message-Id: <54DEE8D2-6ED9-42D4-B480-299C23CB2D66@FreeBSD.org> References: <201512112028.tBBKSRtn092966@repo.freebsd.org> To: Kai Wang 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: Sun, 13 Dec 2015 09:13:22 -0000 --Apple-Mail=_91055249-97B0-46CB-ADBA-5F29D2DB48BD Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 13 Dec 2015, at 09:43, Kai Wang wrote: >=20 > 2015-12-13 7:04 GMT+01:00 Adrian Chadd : > cc1: warnings being treated as errors > = /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../cont= rib/elftoolchain/readelf/readelf.c: > In function 'dump_dwarf': > = /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../cont= rib/elftoolchain/readelf/readelf.c:7479: > warning: 'b' may be used uninitialized in this function > = /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../cont= rib/elftoolchain/readelf/readelf.c:7479: > note: 'b' was declared here > = /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../cont= rib/elftoolchain/readelf/readelf.c:4758: > warning: 'pe' may be used uninitialized in this function > = /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../cont= rib/elftoolchain/readelf/readelf.c:4758: > note: 'pe' was declared here >=20 > .. these both seem like legit. >=20 >=20 > Hi, >=20 > Sorry about the breakage. Should be fixed by r292158. > Somehow clang didn't catch this. Had to use gcc to see this warning. Indeed, this is interesting. For clang to warn similarly, the -Wconditional-uninitialized option has to be enabled explicitly, and then you get a lot of them (this is from just before your commit): = /usr/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:4861= :33: error: variable 'pe' may be uninitialized when used here = [-Werror,-Wconditional-uninitialized] dirndx =3D _decode_uleb128(&p, pe); ^~ = /usr/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:4758= :17: note: initialize the variable 'pe' to silence this warning uint8_t *p, *pe; ^ =3D NULL = /usr/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:6167= :8: error: variable 'cie_ra' may be uninitialized when used here = [-Werror,-Wconditional-uninitialized] cie_ra); ^~~~~~ = /usr/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:6060= :19: note: initialize the variable 'cie_ra' to silence this warning Dwarf_Half cie_ra; ^ =3D 0 = /usr/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:6164= :8: error: variable 'cie_caf' may be uninitialized when used here = [-Werror,-Wconditional-uninitialized] cie_caf, cie_daf, low_pc, re->dbg); ^~~~~~~ = /usr/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:6057= :24: note: initialize the variable 'cie_caf' to silence this warning Dwarf_Unsigned cie_caf, cie_daf, cie_instlen, func_len, = fde_length; ^ =3D 0 = /usr/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:6164= :17: error: variable 'cie_daf' may be uninitialized when used here = [-Werror,-Wconditional-uninitialized] cie_caf, cie_daf, low_pc, re->dbg); ^~~~~~~ = /usr/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:6057= :33: note: initialize the variable 'cie_daf' to silence this warning Dwarf_Unsigned cie_caf, cie_daf, cie_instlen, func_len, = fde_length; ^ =3D 0 = /usr/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:7492= :21: error: variable 'b' may be uninitialized when used here = [-Werror,-Wconditional-uninitialized] if (shift < 32 && (b & 0x40) !=3D 0) ^ = /usr/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:7479= :11: note: initialize the variable 'b' to silence this warning uint8_t b; ^ =3D '\0' 5 errors generated. I'll check if there is a specific reason upstream does not enable this warning by default for -Wall. Maybe there is a risk of false positives. -Dimitry --Apple-Mail=_91055249-97B0-46CB-ADBA-5F29D2DB48BD 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.28 iEYEARECAAYFAlZtNqgACgkQsF6jCi4glqNtNgCgqXUa+7zhqWdqsKKuhLLC2dGq 9vcAoKidiRBPCCFY0wX0DQ9ZJwH8nLKL =Q7rP -----END PGP SIGNATURE----- --Apple-Mail=_91055249-97B0-46CB-ADBA-5F29D2DB48BD--