]> Savannah Git Hosting - gnulib.git/commitdiff
pipe-filter-gi, pipe-filter-ii tests: Fix some gcc -Wshadow warnings.
authorBruno Haible <bruno@clisp.org>
Mon, 4 Sep 2023 15:24:35 +0000 (17:24 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 14 Sep 2023 10:10:32 +0000 (12:10 +0200)
* tests/test-pipe-filter-gi1.c (main): Rename local variable 'argv' to
'tr_argv'.
* tests/test-pipe-filter-ii1.c (main): Likewise.

ChangeLog
tests/test-pipe-filter-gi1.c
tests/test-pipe-filter-ii1.c

index 08a06e203adcd4aa1f8d7904b9e229d5521a184e..383aa5162fc68b028698f7052ee77893d8d072cf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 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.
 
index 05bcc08ae919883d0e3e2e02b6900c37fd78d9af..6e70de55978f31a9b1d502fd949d6ef0bc024cc0 100644 (file)
@@ -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);
index 89c40149692e33cf536ed5cdcf3481340687cdc5..03d49b7dcf023c96380c77b017eedb32564ae390 100644 (file)
@@ -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);