This patch fixes -Wshadow=local warnings: ../../gllib/vasnprintf.c:5249:49: warning: declaration of 'i' shadows a previous local ../../gllib/vasnprintf.c:5575:57: warning: declaration of 'i' shadows a previous local ../../gllib/vasnprintf.c:5849:49: warning: declaration of 'i' shadows a previous local ../../gllib/vasnprintf.c:6183:57: warning: declaration of 'i' shadows a previous local
2025-04-26 Bruno Haible <br...@clisp.org> vasnprintf: Fix -Wshadow=local warnings. * lib/vasnprintf.c (VASNPRINTF): Rename local variable 'i' to 'di'. diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c index f1bfcf3161..a5a956603a 100644 --- a/lib/vasnprintf.c +++ b/lib/vasnprintf.c @@ -2517,7 +2517,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, TCHAR_T *buf; TCHAR_T *buf_malloced; const FCHAR_T *cp; - size_t i; + size_t di; DIRECTIVE *dp; /* Output string accumulator. */ DCHAR_T *result; @@ -2581,7 +2581,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, #define ENSURE_ALLOCATION(needed) \ ENSURE_ALLOCATION_ELSE((needed), goto out_of_memory; ) - for (cp = format, i = 0, dp = &d.dir[0]; ; cp = dp->dir_end, i++, dp++) + for (cp = format, di = 0, dp = &d.dir[0]; ; cp = dp->dir_end, di++, dp++) { if (cp != dp->dir_start) { @@ -2604,7 +2604,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, while (--n > 0); } } - if (i == d.count) + if (di == d.count) break; /* Execute a single directive. */