]> Savannah Git Hosting - gnulib.git/commitdiff
rename: avoid unused-but-set-variable compiler warning
authorBen Walton <bdwalton@gmail.com>
Mon, 2 Jun 2014 19:13:54 +0000 (20:13 +0100)
committerPádraig Brady <P@draigBrady.com>
Tue, 3 Jun 2014 10:40:39 +0000 (11:40 +0100)
* lib/rename.c (rpl_rename):  In the non-Win32 variant of rpl_rename,
it is possible that dst_exists may be set but not used.  Mark it with
the unused attribute to avoid compiler warnings.

Signed-off-by: Ben Walton <bdwalton@gmail.com>
ChangeLog
lib/rename.c

index 9bb17b13f138802592cc5da02e40072522ad45bc..b08418164b77000ab79f246cf18ad4714ef2689b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2014-06-03  Ben Walton  <bdwalton@gmail.com>
+
+       rename: avoid unused-but-set-variable compiler warning
+       * lib/rename.c (rpl_rename):  In the non-Win32 variant of rpl_rename,
+       it is possible that dst_exists may be set but not used.  Mark it with
+       the unused attribute to avoid compiler warnings.
+
 2014-06-02  Ben Walton  <bdwalton@gmail.com>
 
        rename: mark a label as potentially unused
index b99b0046ea2c0f48c0eee39eed3586f3e2315c7a..608f83873a290b53d50c3f4df79c75a96d9e2ef9 100644 (file)
@@ -285,7 +285,7 @@ rpl_rename (char const *src, char const *dst)
   char *dst_temp = (char *) dst;
   bool src_slash;
   bool dst_slash;
-  bool dst_exists;
+  bool dst_exists _GL_UNUSED;
   int ret_val = -1;
   int rename_errno = ENOTDIR;
   struct stat src_st;