From: Cédric Le Goater Date: Mon, 12 Jan 2026 12:31:46 +0000 (+0100) Subject: tests/qtest: Fix build error X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aef386e0b14a535e0977ad9b48d6b2eb672837a7;p=thirdparty%2Fqemu.git tests/qtest: Fix build error Newer gcc compiler (version 16.0.0 20260103 (Red Hat 16.0.0-0) (GCC)) detects an unused variable error: ../tests/qtest/libqtest.c: In function ‘qtest_qom_has_concrete_type’: ../tests/qtest/libqtest.c:1044:9: error: variable ‘idx’ set but not used [-Werror=unused-but-set-variable=] Remove idx. Cc: Fabiano Rosas Cc: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Link: https://lore.kernel.org/qemu-devel/20260112123146.1010621-1-clg@redhat.com Signed-off-by: Cédric Le Goater --- diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index 132aa51137..794d870085 100644 --- a/tests/qtest/libqtest.c +++ b/tests/qtest/libqtest.c @@ -1042,7 +1042,6 @@ static bool qtest_qom_has_concrete_type(const char *parent_typename, QObject *qobj; QString *qstr; QDict *devinfo; - int idx; if (!list) { QDict *resp; @@ -1067,7 +1066,7 @@ static bool qtest_qom_has_concrete_type(const char *parent_typename, } } - for (p = qlist_first(list), idx = 0; p; p = qlist_next(p), idx++) { + for (p = qlist_first(list); p; p = qlist_next(p)) { devinfo = qobject_to(QDict, qlist_entry_obj(p)); g_assert(devinfo);