diff mbox

Re: v0.11.0-rc0-347-g562593a - pci-hotplug.c buildfailure

Message ID D5E423455F0B45639F15188EA7CD26DA@FSCPC
State Superseded
Headers show

Commit Message

Sebastian Herbszt Aug. 15, 2009, 9:21 p.m. UTC
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

Comments

Anthony Liguori Aug. 15, 2009, 11:17 p.m. UTC | #1
Sebastian Herbszt wrote:
>
> Anthony, there is a second report [1] about this problem. The 
> following patch makes
> the compiler happy.

Please post as a top level patch with a Signed-off-by.

Regards,

Anthony Liguori
diff mbox

Patch

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