[PATCH] Avoid compiler warnings in virCPUDefStealModel

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

 



Old GCC on CentOS 6 thinks vendor and vendor_id might be used
uninitialized in virCPUDefStealModel. The compiler is wrong, though.

Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
---

Pushed as a build breaker.

 src/conf/cpu_conf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c
index 9eb69c9..1bcceed 100644
--- a/src/conf/cpu_conf.c
+++ b/src/conf/cpu_conf.c
@@ -144,8 +144,8 @@ virCPUDefStealModel(virCPUDefPtr dst,
                     virCPUDefPtr src,
                     bool keepVendor)
 {
-    char *vendor;
-    char *vendor_id;
+    char *vendor = NULL;
+    char *vendor_id = NULL;
 
     if (keepVendor) {
         VIR_STEAL_PTR(vendor, dst->vendor);
-- 
2.10.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux