* [PATCH] gdbstub: fix compiler complaining
@ 2020-03-26 15:14 Denis Plotnikov
2020-03-26 19:50 ` Richard Henderson
2020-03-27 9:07 ` Alex Bennée
0 siblings, 2 replies; 3+ messages in thread
From: Denis Plotnikov @ 2020-03-26 15:14 UTC (permalink / raw)
To: qemu-devel; +Cc: philmd, alex.bennee
./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 <dplotnikov@virtuozzo.com>
---
gdbstub.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gdbstub.c b/gdbstub.c
index 013fb1ac0f..171e150950 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 {
--
2.17.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] gdbstub: fix compiler complaining
2020-03-26 15:14 [PATCH] gdbstub: fix compiler complaining Denis Plotnikov
@ 2020-03-26 19:50 ` Richard Henderson
2020-03-27 9:07 ` Alex Bennée
1 sibling, 0 replies; 3+ messages in thread
From: Richard Henderson @ 2020-03-26 19:50 UTC (permalink / raw)
To: Denis Plotnikov, qemu-devel; +Cc: alex.bennee, philmd
On 3/26/20 8:14 AM, Denis Plotnikov wrote:
> ./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 <dplotnikov@virtuozzo.com>
> ---
> gdbstub.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] gdbstub: fix compiler complaining
2020-03-26 15:14 [PATCH] gdbstub: fix compiler complaining Denis Plotnikov
2020-03-26 19:50 ` Richard Henderson
@ 2020-03-27 9:07 ` Alex Bennée
1 sibling, 0 replies; 3+ messages in thread
From: Alex Bennée @ 2020-03-27 9:07 UTC (permalink / raw)
To: Denis Plotnikov; +Cc: philmd, qemu-devel
Denis Plotnikov <dplotnikov@virtuozzo.com> writes:
> ./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 <dplotnikov@virtuozzo.com>
Queued to for-5.0/random-fixes, thanks.
> ---
> gdbstub.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/gdbstub.c b/gdbstub.c
> index 013fb1ac0f..171e150950 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 {
--
Alex Bennée
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-03-27 9:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-26 15:14 [PATCH] gdbstub: fix compiler complaining Denis Plotnikov
2020-03-26 19:50 ` Richard Henderson
2020-03-27 9:07 ` Alex Bennée
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).