diff mbox series

[2/3] lib: framework: Remove unused variable to avoid compiler warning

Message ID 20260507065638.2809947-3-thuth@redhat.com
State Accepted
Headers show
Series Fix compiler warnings with GCC v16 | expand

Commit Message

Thomas Huth May 7, 2026, 6:56 a.m. UTC
From: Thomas Huth <thuth@redhat.com>

With GCC 16, the compilation fails with:

 fwts_framework.c: In function 'fwts_framework_show_tests':
 fwts_framework.c:325:13: error: variable 'total' set but not used
  [-Werror=unused-but-set-variable=]
   325 |         int total = 0;
       |             ^~~~~
 cc1: all warnings being treated as errors

Remove the unused variable to fix the problem.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 src/lib/src/fwts_framework.c | 2 --
 1 file changed, 2 deletions(-)
diff mbox series

Patch

diff --git a/src/lib/src/fwts_framework.c b/src/lib/src/fwts_framework.c
index 3bcb3839..bda25597 100644
--- a/src/lib/src/fwts_framework.c
+++ b/src/lib/src/fwts_framework.c
@@ -319,7 +319,6 @@  static void fwts_framework_show_tests(fwts_framework *fw, const bool full)
 	fwts_list sorted;
 	int i;
 	bool need_nl = false;
-	int total = 0;
 
 	/* Dump out tests registered under all categories */
 	for (i = 0; categories[i].title != NULL; i++) {
@@ -355,7 +354,6 @@  static void fwts_framework_show_tests(fwts_framework *fw, const bool full)
 							test->ops->total_tests > 1 ? "s" : "");
 						for (j = 0; j < test->ops->total_tests; j++)
 							printf("  %s\n", test->ops->minor_tests[j].name);
-						total += test->ops->total_tests;
 					}
 					else {
 						printf(" %-15.15s %s\n", test->name,