From eb0662ed9a6c84deae8c443d6d9a09f5b9c435f1 Mon Sep 17 00:00:00 2001 From: Ben Walton Date: Mon, 2 Jun 2014 20:13:54 +0100 Subject: [PATCH] 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 --- ChangeLog | 7 +++++++ lib/rename.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) 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; -- 2.39.5