trace/control: Fix -Wunused-but-set-global warning with clang 23+
PATCH 1/1 trace/control: Fix -Wunused-but-set-global warning with clang 23+
../trace/control.c:41:13: error: variable 'init_trace_on_startup' set but not used [-Werror,-Wunused-but-set-global]
41 | static bool init_trace_on_startup;
| ^
1 error generated.
--- trace/control.c | 4 ++++ 1 file changed, 4 insertions(+)
trace/control.c +4 -0
@@ -38,7 +38,9 @@ static TraceEventGroup *event_groups;static size_t nevent_groups;static uint32_t next_id;static uint32_t next_vcpu_id; +#ifdef CONFIG_TRACE_SIMPLE static bool init_trace_on_startup; +#endif static char *trace_opts_file;QemuOptsList qemu_trace_opts = {
@@ -295,7 +297,9 @@ void trace_opt_parse(const char *optstr)trace_enable_events (qemu_opt_get (opts,"enable" )); }trace_init_events (qemu_opt_get (opts,"events" )); +#ifdef CONFIG_TRACE_SIMPLE init_trace_on_startup = true; +#endif g_free (trace_opts_file); trace_opts_file =g_strdup (qemu_opt_get (opts,"file" ));qemu_opts_del (opts);
Signature · 1 line
2.51.0
CC trace maintainer.
Quoted 9 lines · Tom Stellard
../trace/control.c:41:13: error: variable 'init_trace_on_startup' set but not used [-Werror,-Wunused-but-set-global]
41 | static boolinit_trace_on_startup;
| ^
1 error generated.Signed-off-by Tom Stellard <[email protected]>--- trace/control.c | 4 ++++ 1 file changed, 4 insertions(+)
Quoted 29 lines
trace/control.c +4
-0@@ -38,7 +38,9 @@ static TraceEventGroup *event_groups;static size_t nevent_groups;static uint32_t next_id;static uint32_t next_vcpu_id; +#ifdef CONFIG_TRACE_SIMPLE static bool init_trace_on_startup; +#endif static char *trace_opts_file;QemuOptsList qemu_trace_opts = {@@ -295,7 +297,9 @@ void trace_opt_parse(const char *optstr)trace_enable_events (qemu_opt_get (opts,"enable" )); }trace_init_events (qemu_opt_get (opts,"events" )); +#ifdef CONFIG_TRACE_SIMPLE init_trace_on_startup = true; +#endif g_free (trace_opts_file); trace_opts_file =g_strdup (qemu_opt_get (opts,"file" ));qemu_opts_del (opts);Signature · 1 line
2.51.0
With regards,
Daniel
Signature · 3 lines
|: https://berrange.com ~~ https://hachyderm.io/@berrange :| |: https://libvirt.org ~~ https://entangle-photo.org :| |: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
Stefan Hajnoczi
AppliedQuoted 39 lines · Daniel P. Berrangé
CC trace maintainer.
Quoted 9 lines · Tom Stellard
../trace/control.c:41:13: error: variable 'init_trace_on_startup' set but not used [-Werror,-Wunused-but-set-global]
41 | static boolinit_trace_on_startup;
| ^
1 error generated.Signed-off-by Tom Stellard <[email protected]>--- trace/control.c | 4 ++++ 1 file changed, 4 insertions(+)Reviewed-by Daniel P. Berrangé <[email protected]>Quoted 24 lines
trace/control.c +4
-0@@ -38,7 +38,9 @@ static TraceEventGroup *event_groups;static size_t nevent_groups;static uint32_t next_id;static uint32_t next_vcpu_id; +#ifdef CONFIG_TRACE_SIMPLE static bool init_trace_on_startup; +#endif static char *trace_opts_file;QemuOptsList qemu_trace_opts = {@@ -295,7 +297,9 @@ void trace_opt_parse(const char *optstr)trace_enable_events (qemu_opt_get (opts,"enable" )); }trace_init_events (qemu_opt_get (opts,"events" )); +#ifdef CONFIG_TRACE_SIMPLE init_trace_on_startup = true; +#endif g_free (trace_opts_file); trace_opts_file =g_strdup (qemu_opt_get (opts,"file" ));
Quoted 13 lines
Quoted 5 lines
trace/control.c +0
-0qemu_opts_del (opts);Signature · 1 line
2.51.0With regards,
DanielSignature · 3 lines
|: https://berrange.com ~~ https://hachyderm.io/@berrange :| |: https://libvirt.org ~~ https://entangle-photo.org :| |: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
Thanks, applied to my tracing tree:
https://gitlab.com/stefanha/qemu/commits/tracing
Stefan