[libvirt] [PATCH] qemu: Silent bogus warning about unitialized variable

Jiri Denemark jdenemar at redhat.com
Wed Feb 1 15:20:10 UTC 2012


GCC complaints about uninitialized use of len, which however is only
used when errors != NULL and in that case len is always initialized.
It's trivial to silence this by always initializing len.
---
Pushed as both trivial and build-breaking.

 daemon/remote.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/daemon/remote.c b/daemon/remote.c
index 8fbcf43..26ac4a6 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -3608,7 +3608,7 @@ static int remoteDispatchDomainGetDiskErrors(
     int rv = -1;
     virDomainPtr dom = NULL;
     virDomainDiskErrorPtr errors = NULL;
-    int len;
+    int len = 0;
     struct daemonClientPrivate *priv =
         virNetServerClientGetPrivateData(client);
 
-- 
1.7.8.4




More information about the libvir-list mailing list