tests/qtest: Fix build error
PATCH 1/1 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.
--- tests/qtest/libqtest.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
tests/qtest/libqtest.c +1 -2
@@ -1041,7 +1041,6 @@ static bool qtest_qom_has_concrete_type(const char *parent_typename,QObject *qobj;QString *qstr;QDict *devinfo; -int idx;if (!list) {QDict *resp;
@@ -1066,7 +1065,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);
Signature · 1 line
2.52.0
Quoted 6 lines · Cédric Le Goater
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=]
Quoted 8 lines
Remove idx.
Cc Fabiano Rosas <[email protected]>Cc Laurent Vivier <[email protected]>Signed-off-by Cédric Le Goater <[email protected]>--- tests/qtest/libqtest.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Cédric Le Goater
AppliedQuoted 28 lines · Cédric Le Goater
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]>Signed-off-by Cédric Le Goater <[email protected]>--- tests/qtest/libqtest.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)tests/qtest/libqtest.c +0
-1@@ -1041,7 +1041,6 @@ static bool qtest_qom_has_concrete_type(const char *parent_typename,QObject *qobj;QString *qstr;QDict *devinfo; -int idx;if (!list) {QDict *resp;
tests/qtest/libqtest.c static bool qtest_qom_has_concrete_type(const char *parent_typename, · line 1071
Quoted 8 lines
tests/qtest/libqtest.c +1
-1@@ -1066,7 +1065,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);
Applied to vfio-next.
Thanks,
C.