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 <farosas@suse.de>
Cc: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/qemu-devel/20260112123146.1010621-1-clg@redhat.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
QObject *qobj;
QString *qstr;
QDict *devinfo;
- int idx;
if (!list) {
QDict *resp;
}
}
- 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);