[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: v0.11.0-rc0-347-g562593a - pci-hotplug.c buildfailure

From: Sebastian Herbszt
Subject: [Qemu-devel] Re: v0.11.0-rc0-347-g562593a - pci-hotplug.c buildfailure
Date: Sat, 15 Aug 2009 23:21:56 +0200

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 
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];

reply via email to

[Prev in Thread] Current Thread [Next in Thread]