Avoid a GCC warning with GCC >= 7.
diff --git a/ChangeLog b/ChangeLog
index 8d93447..c7f1db2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2020-08-06  Bruno Haible  <bruno@clisp.org>
+
+	Avoid a GCC warning with GCC >= 7.
+	Reported by Reini Urban <rurban@cpan.org>
+	in <https://savannah.gnu.org/bugs/?58903>.
+	* lib/gentranslit.c (main): Reset i to 0 each time p gets a new value.
+	Add assertion about i's possible values.
+
 2020-04-05  Bruno Haible  <bruno@clisp.org>
 
 	Fix an autogen.sh failure (regression from 2016-12-04).
diff --git a/lib/gentranslit.c b/lib/gentranslit.c
index 864f837..d008293 100644
--- a/lib/gentranslit.c
+++ b/lib/gentranslit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2003, 2005, 2011-2012, 2016, 2018 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2003, 2005, 2011-2012, 2016, 2018, 2020 Free Software Foundation, Inc.
    This file is part of the GNU LIBICONV Library.
 
    The GNU LIBICONV Library is free software; you can redistribute it
@@ -182,10 +182,16 @@
       if (tables[t].usecount > 1) {
         char* s;
         if (p == tables[t].minline >> 5) {
+          i++;
+          /* i is the number of tables with the same (tables[t].minline >> 5)
+             that we have seen so far. Since the tables[t].minline values are
+             strongly monotonically increasing, there are at most 32 of them. */
+          if (!(i >= 0 && i <= 32)) abort();
           s = (char*) malloc(4+1+2+1);
-          sprintf(s, "%02x_%d", p, ++i);
+          sprintf(s, "%02x_%d", p, i);
         } else {
           p = tables[t].minline >> 5;
+          i = 0;
           s = (char*) malloc(4+1);
           sprintf(s, "%02x", p);
         }