From: Bruno Haible Date: Sat, 26 Apr 2025 08:49:38 +0000 (+0200) Subject: vasnprintf: Fix -Wshadow=local warnings. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=add7092f5056afa8856e33e143e72f29d5c80ac3;p=gnulib.git vasnprintf: Fix -Wshadow=local warnings. * lib/vasnprintf.c (VASNPRINTF): Rename local variable 'i' to 'di'. --- diff --git a/ChangeLog b/ChangeLog index b7ab0df56b..1e7d87b8ad 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2025-04-26 Bruno Haible + + vasnprintf: Fix -Wshadow=local warnings. + * lib/vasnprintf.c (VASNPRINTF): Rename local variable 'i' to 'di'. + 2025-04-26 Bruno Haible Silence gcc 15 -Wunterminated-string-initialization warnings. 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. */