diff mbox series

[1/3] fwts_args: Silence compiler warning about unused "master_option_index"

Message ID 20260507065638.2809947-2-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:

 fwts_args.c: In function 'fwts_args_parse':
 fwts_args.c:109:13: error: variable 'master_option_index' set but not used
  [-Werror=unused-but-set-variable=]
   109 |         int master_option_index;
       |             ^~~~~~~~~~~~~~~~~~~
 cc1: all warnings being treated as errors

Remove the unused code to fix the problem.

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

Patch

diff --git a/src/lib/src/fwts_args.c b/src/lib/src/fwts_args.c
index 6df3b620..e09aa4a9 100644
--- a/src/lib/src/fwts_args.c
+++ b/src/lib/src/fwts_args.c
@@ -106,7 +106,6 @@  int fwts_args_parse(fwts_framework *fw, const int argc, char * const argv[])
 	int i;
 	int c;
 	int option_index;
-	int master_option_index;
 	int translated_long_option_index;
 	int ret = FWTS_OK;
 	char *short_options = NULL;
@@ -185,7 +184,6 @@  int fwts_args_parse(fwts_framework *fw, const int argc, char * const argv[])
 	}
 
 	for (;;) {
-		master_option_index = total_options;
 		translated_long_option_index = 0;
 		c = getopt_long(argc, argv, short_options, long_options, &option_index);
 		if (c == -1)
@@ -222,8 +220,6 @@  int fwts_args_parse(fwts_framework *fw, const int argc, char * const argv[])
 				if (ret != FWTS_OK)
 					goto exit;
 				break;
-			} else {
-				master_option_index -= options_table->num_options;
 			}
 
 		}