changeset 37374:d6f262188177

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. Signed-off-by: Ben Walton <bdwalton@gmail.com>
author Ben Walton <bdwalton@gmail.com>
date Mon, 02 Jun 2014 20:13:54 +0100
parents 782201c2a8fc
children bcfef16e52b4
files ChangeLog lib/rename.c
diffstat 2 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Jun 02 20:08:05 2014 +0100
+++ b/ChangeLog	Mon Jun 02 20:13:54 2014 +0100
@@ -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
--- a/lib/rename.c	Mon Jun 02 20:08:05 2014 +0100
+++ b/lib/rename.c	Mon Jun 02 20:13:54 2014 +0100
@@ -285,7 +285,7 @@
   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;