From patchwork Sat Aug 15 21:21:56 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: v0.11.0-rc0-347-g562593a - pci-hotplug.c buildfailure Date: Sat, 15 Aug 2009 11:21:56 -0000 From: Sebastian Herbszt X-Patchwork-Id: 31477 Message-Id: To: "Anthony Liguori" Cc: Hans de Bruin , qemu-devel@nongnu.org Sebastian Herbszt wrote: > Anthony Liguori wrote: >> Sebastian Herbszt wrote: >>> CC i386-softmmu/pci-hotplug.o >>> cc1: warnings being treated as errors >>> /v0.11.0-rc0-347-g562593a/hw/pci-hotplug.c: In function >>> 'pci_device_hot_add': >>> /v0.11.0-rc0-347-g562593a/hw/pci-hotplug.c:102: warning: 'dinfo' may >>> be used uninitialized in this function >>> /v0.11.0-rc0-347-g562593a/hw/pci-hotplug.c:102: note: 'dinfo' was >>> declared here >>> make[1]: *** [pci-hotplug.o] Error 1 >>> make: *** [subdir-i386-softmmu] Error 2 >> >> What version of gcc? > > gcc version 4.2.1 (SUSE Linux) > >> It's wrong, there's no way it can be uninitialized. Anthony, there is a second report [1] about this problem. The following patch makes the compiler happy. [1] http://lists.gnu.org/archive/html/qemu-devel/2009-08/msg00736.html - Sebastian --- a/hw/pci-hotplug.c +++ b/hw/pci-hotplug.c @@ -99,7 +99,7 @@ static PCIDevice *qemu_pci_hot_add_storage(Monitor *mon, const char *opts) { PCIDevice *dev; - DriveInfo *dinfo; + DriveInfo *dinfo = NULL; int type = -1; char buf[128];