Re: [PATCH] run-command.c: Fix unused variables warning with gcc 4.6

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

 



Michael Schubert venit, vidit, dixit 26.04.2011 14:28:
> As of gcc 4.6 -Wall includes -Wunused-but-set-variable. Remove all
> unused variables to prevent those warnings.
> 
> Signed-off-by: Michael Schubert <mschub@xxxxxxxxxxxxx>
> ---
>  run-command.c |   10 ++++------
>  1 files changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/run-command.c b/run-command.c
> index f91e446..6e0be54 100644
> --- a/run-command.c
> +++ b/run-command.c
> @@ -67,21 +67,19 @@ static int child_notifier = -1;
> 
>  static void notify_parent(void)
>  {
> -	ssize_t unused;
> -	unused = write(child_notifier, "", 1);
> +	write(child_notifier, "", 1);
>  }
> 
>  static NORETURN void die_child(const char *err, va_list params)
>  {
>  	char msg[4096];
> -	ssize_t unused;
>  	int len = vsnprintf(msg, sizeof(msg), err, params);
>  	if (len > sizeof(msg))
>  		len = sizeof(msg);
> 
> -	unused = write(child_err, "fatal: ", 7);
> -	unused = write(child_err, msg, len);
> -	unused = write(child_err, "\n", 1);
> +	write(child_err, "fatal: ", 7);
> +	write(child_err, msg, len);
> +	write(child_err, "\n", 1);
>  	exit(128);
>  }
>  #endif

git log -S"unused" origin/master run-command.c

shows that these dummies were introduced for a reason. How do you
invalidate that?

Michael
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]