Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: unused variables



On 19 June 2011 02:18, Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx> wrote:
> On Sun, 19 Jun 2011 00:56:43 +0100
> Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx> wrote:
>> gcc 4.6.0 is producing a range of "value set but not used" warnings that
>> will want looking at.
>
> All these seem to be trivially pukka: they are local or static variables
> we are never referring to apart from the points where I've made the
> changes.  One case needed some conditional compilation, the rest just
> stripping out.
>
> It's probably too late to be able to tell if any of these actually
> should be being referred to later.
>
> Watch carefully in case I've removed the right hand side of an
> assignment with side effects, but I think I've checked for that...
> In such cases I've used a cast to void in case we ever want to run
> lint.  Joke.
>
> Index: Src/Zle/zle_tricky.c
> ===================================================================
> RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_tricky.c,v
> retrieving revision 1.108
> diff -p -u -r1.108 zle_tricky.c
> --- Src/Zle/zle_tricky.c        9 May 2011 09:49:09 -0000       1.108
> +++ Src/Zle/zle_tricky.c        19 Jun 2011 00:14:17 -0000
> @@ -543,8 +543,6 @@ parambeg(char *s)
>            n = skipparens(Inpar, Outpar, &b);
>
>            for (tb = p - 1; tb > s && *tb != Outbrace && *tb != Inbrace; tb--);
> -           if (tb > s && *tb == Inbrace && (tb[-1] == String || *tb == Qstring))
> -               nest = 1;
>        }
>
>        /* Ignore the stuff before the parameter name. */

Looks like we can remove this for loop too, it only changes tb which
goes out of scope with that closing brace.


-- 
Mikael Magnusson



Messages sorted by: Reverse Date, Date, Thread, Author