bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCH] lib/rename.c: rpl_rename - Avoid unused-but-set-variable com


From: Pádraig Brady
Subject: Re: [PATCH] lib/rename.c: rpl_rename - Avoid unused-but-set-variable compiler warning
Date: Mon, 02 Jun 2014 20:31:21 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

On 06/02/2014 08:13 PM, Ben Walton wrote:
>   * 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 <address@hidden>
> ---
>  lib/rename.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/rename.c b/lib/rename.c
> index 55130d8..099066d 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;
> 

Have to say that I don't see this from looking at the code,
since it seems to just return or set dst_exists?

Pádraig.



reply via email to

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