gdbstub: fix compiler complaining
PATCH 1/1 gdbstub: fix compiler complaining
./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 errorsSigned-off-by Denis Plotnikov <[email protected]>
--- gdbstub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
gdbstub.c +2 -2
@@ -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 {
Signature · 1 line
2.17.0
Quoted 11 lines · Denis Plotnikov
./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 errorsQuoted 4 lines
Signed-off-by Denis Plotnikov <[email protected]>--- gdbstub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by Richard Henderson <[email protected]>
r~
Alex Bennée
AppliedQuoted 11 lines · Denis Plotnikov
./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 errorsQuoted 1 line
Signed-off-by Denis Plotnikov <[email protected]>
Queued to for-5.0/random-fixes, thanks.
Quoted 19 lines
--- gdbstub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)gdbstub.c +2
-2@@ -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 {
Signature · 1 line
Alex Bennée