From: Ben Walton Date: Mon, 2 Jun 2014 19:13:54 +0000 (+0100) Subject: rename: avoid unused-but-set-variable compiler warning X-Git-Tag: v1.0~7364 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=eb0662ed9a6c84deae8c443d6d9a09f5b9c435f1;p=gnulib.git 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 --- diff --git a/ChangeLog b/ChangeLog index 9bb17b13f1..b08418164b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2014-06-03 Ben Walton + + 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 rename: mark a label as potentially unused diff --git a/lib/rename.c b/lib/rename.c index b99b0046ea..608f83873a 100644 --- a/lib/rename.c +++ b/lib/rename.c @@ -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;