bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ftw.c: avoid shadowing warning


From: Jim Meyering
Subject: ftw.c: avoid shadowing warning
Date: Sun, 12 Jan 2003 18:55:56 +0100

In using the recently-modified ftw.c outside of the GNU libc, I saw
this warning:

  ftw.c:637: warning: declaration of `save_err' shadows a previous local
  ftw.c:511: warning: shadowed declaration is here

I fixed it by renaming the variable in the latter declaration.

2003-01-12  Jim Meyering  <address@hidden>

        * io/ftw.c (ftw_startup): Rename local-shadowing local to pacify gcc.

Index: io/ftw.c
===================================================================
RCS file: /cvs/libc/io/ftw.c,v
retrieving revision 1.33
diff -u -p -u -p -r1.33 ftw.c
--- io/ftw.c    17 Dec 2002 00:04:53 -0000      1.33
+++ io/ftw.c    12 Jan 2003 17:03:30 -0000
@@ -588,10 +634,10 @@ ftw_startup (const char *dir, int is_nft
   /* Return to the start directory (if necessary).  */
   if (cwd != NULL)
     {
-      int save_err = errno;
+      int saved_errno = errno;
       __chdir (cwd);
       free (cwd);
-      __set_errno (save_err);
+      __set_errno (saved_errno);
     }
 
   /* Free all memory.  */

Attachment: pgpHeOhFTmcWg.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]