From: Bruno Haible Date: Mon, 4 Sep 2023 15:24:35 +0000 (+0200) Subject: pipe-filter-gi, pipe-filter-ii tests: Fix some gcc -Wshadow warnings. X-Git-Tag: v1.0~829 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=52eecfbc91bd1f61b1a2aefe72f0b69fb8e19812;p=gnulib.git pipe-filter-gi, pipe-filter-ii tests: Fix some gcc -Wshadow warnings. * tests/test-pipe-filter-gi1.c (main): Rename local variable 'argv' to 'tr_argv'. * tests/test-pipe-filter-ii1.c (main): Likewise. --- diff --git a/ChangeLog b/ChangeLog index 86b8255428..7ab50acc87 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2023-09-04 Bruno Haible + pipe-filter-gi, pipe-filter-ii tests: Fix some gcc -Wshadow warnings. + * tests/test-pipe-filter-gi1.c (main): Rename local variable 'argv' to + 'tr_argv'. + * tests/test-pipe-filter-ii1.c (main): Likewise. + argv-iter tests: Avoid gcc -Wanalyzer-out-of-bounds warning. * tests/test-argv-iter.c (main): Simplify logic. diff --git a/tests/test-pipe-filter-gi1.c b/tests/test-pipe-filter-gi1.c index 05bcc08ae9..6e70de5597 100644 --- a/tests/test-pipe-filter-gi1.c +++ b/tests/test-pipe-filter-gi1.c @@ -85,7 +85,7 @@ main (int argc, char *argv[]) /* Convert it to uppercase, line by line. */ { - const char *argv[4]; + const char *tr_argv[4]; struct locals l; struct pipe_filter_gi *f; int result; @@ -93,12 +93,12 @@ main (int argc, char *argv[]) l.input = input; l.nread = 0; - argv[0] = tr_program; - argv[1] = "abcdefghijklmnopqrstuvwxyz"; - argv[2] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - argv[3] = NULL; + tr_argv[0] = tr_program; + tr_argv[1] = "abcdefghijklmnopqrstuvwxyz"; + tr_argv[2] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + tr_argv[3] = NULL; - f = pipe_filter_gi_create ("tr", tr_program, argv, false, true, + f = pipe_filter_gi_create ("tr", tr_program, tr_argv, false, true, prepare_read, done_read, &l); ASSERT (f != NULL); result = pipe_filter_gi_write (f, input, input_size); diff --git a/tests/test-pipe-filter-ii1.c b/tests/test-pipe-filter-ii1.c index 89c4014969..03d49b7dcf 100644 --- a/tests/test-pipe-filter-ii1.c +++ b/tests/test-pipe-filter-ii1.c @@ -107,7 +107,7 @@ main (int argc, char *argv[]) /* Convert it to uppercase, line by line. */ { - const char *argv[4]; + const char *tr_argv[4]; struct locals l; int result; @@ -116,12 +116,12 @@ main (int argc, char *argv[]) l.nwritten = 0; l.nread = 0; - argv[0] = tr_program; - argv[1] = "abcdefghijklmnopqrstuvwxyz"; - argv[2] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - argv[3] = NULL; + tr_argv[0] = tr_program; + tr_argv[1] = "abcdefghijklmnopqrstuvwxyz"; + tr_argv[2] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + tr_argv[3] = NULL; - result = pipe_filter_ii_execute ("tr", tr_program, argv, false, true, + result = pipe_filter_ii_execute ("tr", tr_program, tr_argv, false, true, prepare_write, done_write, prepare_read, done_read, &l);