qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v1 7/7] gdbstub: fix compiler complaining


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v1 7/7] gdbstub: fix compiler complaining
Date: Fri, 27 Mar 2020 11:56:47 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0

On 3/27/20 10:49 AM, Alex Bennée wrote:
From: Denis Plotnikov <address@hidden>

     ./gdbstub.c: In function ‘handle_query_thread_extra’:
         /usr/include/glib-2.0/glib/glib-autocleanups.h:28:10:
     error: ‘cpu_name’ may be used uninitialized in this function
     [-Werror=maybe-uninitialized]
         g_free (*pp);
                ^
     ./gdbstub.c:2063:26: note: ‘cpu_name’ was declared here
         g_autofree char *cpu_name;
                          ^
     cc1: all warnings being treated as errors

Signed-off-by: Denis Plotnikov <address@hidden>
Message-Id: <address@hidden>
Reported-by: Euler Robot <address@hidden>
Reported-by: Chen Qun <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Alex Bennée <address@hidden>
---
  gdbstub.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdbstub.c b/gdbstub.c
index 013fb1ac0f1..171e1509509 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -2060,8 +2060,8 @@ static void handle_query_thread_extra(GdbCmdContext 
*gdb_ctx, void *user_ctx)
          /* Print the CPU model and name in multiprocess mode */
          ObjectClass *oc = object_get_class(OBJECT(cpu));
          const char *cpu_model = object_class_get_name(oc);
-        g_autofree char *cpu_name;
-        cpu_name  = object_get_canonical_path_component(OBJECT(cpu));
+        g_autofree char *cpu_name =
+            object_get_canonical_path_component(OBJECT(cpu));
          g_string_printf(rs, "%s %s [%s]", cpu_model, cpu_name,
                          cpu->halted ? "halted " : "running");
      } else {


Reviewed-by: Philippe Mathieu-Daudé <address@hidden>




reply via email to

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