[PATCH GnuPG 2/7] common: fix -Wunused-but-set-variable

Sam James via Gnupg-devel <[email protected]> Wed, 28 Jan 2026 12:35:02 +0000
Newsgroups gmane.comp.encryption.gpg.devel
Message-ID <29b0baaa1c1c575ddfba96da2fbe20ee840aa486.1769603707.git.sam@gentoo.org>
* common/ssh-utils.c (get_fingerprint): Drop unused 'idx' in loop.

--

idx was never used other than being incremented. Found by GCC 16's
enhanced -Wunused-but-set-variable.

Signed-off-by: Sam James <[email protected]>
---
 common/ssh-utils.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/common/ssh-utils.c b/common/ssh-utils.c
index d27e2e200..9764ae68c 100644
--- a/common/ssh-utils.c
+++ b/common/ssh-utils.c
@@ -82,7 +82,6 @@ get_fingerprint (gcry_sexp_t key, int algo,
   gcry_sexp_t l2 = NULL;
   const char *s;
   char *name = NULL;
-  int idx;
   const char *elems;
   gcry_md_hd_t md = NULL;
   int blobmode = 0;
@@ -181,7 +180,7 @@ get_fingerprint (gcry_sexp_t key, int algo,
     goto leave;
 
 
-  for (idx = 0, s = elems; *s; s++, idx++)
+  for (s = elems; *s; s++)
     {
       l2 = gcry_sexp_find_token (list, s, 1);
       if (!l2)
-- 
2.52.0