From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:57228) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SoH6t-0002C7-SI for qemu-devel@nongnu.org; Mon, 09 Jul 2012 12:46:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SoH6r-0003p3-RQ for qemu-devel@nongnu.org; Mon, 09 Jul 2012 12:46:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:14747) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SoH6r-0003ov-JN for qemu-devel@nongnu.org; Mon, 09 Jul 2012 12:46:53 -0400 Message-ID: <4FFB0AF8.30906@redhat.com> Date: Mon, 09 Jul 2012 10:46:48 -0600 From: Eric Blake MIME-Version: 1.0 References: <1341843388-5663-1-git-send-email-kwolf@redhat.com> <1341843388-5663-24-git-send-email-kwolf@redhat.com> <4FFAF261.5010804@codemonkey.ws> <4FFAF7A9.8070506@redhat.com> In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigA88783909E4AEDE07B2B641E" Subject: Re: [Qemu-devel] [PATCH 23/25] fdc: Move floppy geometry guessing back from block.c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Kevin Wolf , qemu-devel@nongnu.org, Anthony Liguori This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigA88783909E4AEDE07B2B641E Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 07/09/2012 10:07 AM, Markus Armbruster wrote: >>> This is an unconditional use of fd_type[0]. If floppy =3D=3D NULL, t= his is=20 >>> dereferencing an uninitialized value. >>> >>> I'm not sure why the explicit initialization was removed... >=20 > Brain fart on my part, sorry. The old loop assigns only if the drive > exists. The new loop assigns unconditionally. Except the whole loop i= s > still conditional. >=20 > Testing can't flag this, because floppy is never null. >=20 >> Looks broken indeed. I just wonder why my gcc (or the buildbots) didn'= t >> complain. >=20 > Me too. Looks like I should upgrade to a more recent gcc. It's probably not the version of the gcc you used, but whether or not your CFLAGS include -O2. Gcc has the (IMO very annoying) limitation that uninitialized-use analysis can only be performed if you are also doing optimization. You have to use a tool like clang or Coverity if you want more reliable uninitialized-use analysis even while building -O0 debug images. --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enigA88783909E4AEDE07B2B641E Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJP+wr4AAoJEKeha0olJ0NqTb4IAKeQfLXP5Pl0UxWVTRndks31 1bxxSAsiztXq9eE4Y9i+pgEEzpqojMx7pELLtUigRh4BJWKQfGVKZ9GHsm2pL1fV bqj4vCQL1Wk+pEeRU0DJLz5ZQQRSZAakegyKUTe8jqfOOuyJT1DfunQmeBxpx3WH 658ghg7E9C7mwZ3qy0/IDepC1PXvFDpQzu5143MWG2sHs+Vd+cwbxy9k3IoeAzZN HPYF6Q/Zo0HHhbAQHAZeJFbtLQkvDMrxz75AnjS4Ju8TX/bL63l23wja51pp0Kei cSGphsf31GR/MB6iR74h2SDr1nHUsUgYnm5V0nZl4Pa+vxAMPUvdBqZrCUWBjHY= =2/P5 -----END PGP SIGNATURE----- --------------enigA88783909E4AEDE07B2B641E--