[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 18/18] plugins: fix -Werror=maybe-uninitialized false-positive
From: |
Alex Bennée |
Subject: |
[PATCH 18/18] plugins: fix -Werror=maybe-uninitialized false-positive |
Date: |
Mon, 3 Feb 2025 14:40:48 +0000 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
../contrib/plugins/cache.c:638:9: error: ‘l2_cache’ may be used uninitialized
[-Werror=maybe-uninitialized]
638 | append_stats_line(rep, l1_dmem_accesses, l1_dmisses,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Is a false-positive, since cores > 1, so the variable is set in the
above loop.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-Id: <20250114104820.2613099-1-marcandre.lureau@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
contrib/plugins/cache.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/plugins/cache.c b/contrib/plugins/cache.c
index 7baff86860..7cfd3df249 100644
--- a/contrib/plugins/cache.c
+++ b/contrib/plugins/cache.c
@@ -603,7 +603,7 @@ static int l2_cmp(gconstpointer a, gconstpointer b)
static void log_stats(void)
{
int i;
- Cache *icache, *dcache, *l2_cache;
+ Cache *icache, *dcache, *l2_cache = NULL;
g_autoptr(GString) rep = g_string_new("core #, data accesses, data misses,"
" dmiss rate, insn accesses,"
--
2.39.5
- [PATCH 12/18] user: Introduce user/signal.h, (continued)
- [PATCH 12/18] user: Introduce user/signal.h, Alex Bennée, 2025/02/03
- [PATCH 08/18] tests/qtest/migration: Add --full option, Alex Bennée, 2025/02/03
- [PATCH 09/18] tests/qtest/migration: Pick smoke tests, Alex Bennée, 2025/02/03
- [PATCH 07/18] Revert "util/timer: avoid deadlock when shutting down", Alex Bennée, 2025/02/03
- [PATCH 13/18] user: Introduce host_interrupt_signal, Alex Bennée, 2025/02/03
- [PATCH 11/18] gdbstub: Try unlinking the unix socket before binding, Alex Bennée, 2025/02/03
- [PATCH 14/18] osdep: Introduce qemu_kill_thread(), Alex Bennée, 2025/02/03
- [PATCH 16/18] docs/user: Document the %d placeholder and suspend=n QEMU_GDB features, Alex Bennée, 2025/02/03
- [PATCH 17/18] tests/tcg: Add late gdbstub attach test, Alex Bennée, 2025/02/03
- [PATCH 18/18] plugins: fix -Werror=maybe-uninitialized false-positive,
Alex Bennée <=