2023-09-04 Bruno Haible <bruno@clisp.org>
+ 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.
/* 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;
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);
/* Convert it to uppercase, line by line. */
{
- const char *argv[4];
+ const char *tr_argv[4];
struct locals l;
int result;
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);