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 <[email protected]>
Cc: Laurent Vivier <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Link: https://lore.kernel.org/qemu-devel/[email protected]
Signed-off-by: Cédric Le Goater <[email protected]>
---
 tests/qtest/libqtest.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c
index 
132aa5113753031f58acf11ab2d4111803eef7be..794d8700857754b8614720bfa5a2d597e73955c1
 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);
 
-- 
2.52.0


Reply via email to