qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH] vl: Fix compile issue with Werror option


From: Mike Qiu
Subject: [Qemu-devel] [PATCH] vl: Fix compile issue with Werror option
Date: Fri, 20 Dec 2013 01:29:50 -0500

Currently, if compile with Werror option, the error message shows
below:

  GEN   config-host.h
  GEN   trace/generated-tracers.h
        CHK version_gen.h
  GEN   trace/generated-tracers.c
  CC    vl.o
vl.c: In function ‘get_boot_devices_list’:
vl.c:1257:21: error: ‘bootpath’ may be used uninitialized
        in this function [-Werror=maybe-uninitialized]
         len = strlen(bootpath) + 1;
                     ^
cc1: all warnings being treated as errors
make: *** [vl.o] Error 1

This patch is to solve this issue.

Signed-off-by: Mike Qiu <address@hidden>
---
 vl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vl.c b/vl.c
index b97728f..d67b284 100644
--- a/vl.c
+++ b/vl.c
@@ -1230,7 +1230,7 @@ char *get_boot_devices_list(size_t *size, bool 
ignore_suffixes)
     char *list = NULL;
 
     QTAILQ_FOREACH(i, &fw_boot_order, link) {
-        char *devpath = NULL, *bootpath;
+        char *devpath = NULL, *bootpath = NULL;
         size_t len;
 
         if (i->dev) {
-- 
1.8.2.1




reply via email to

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