From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10311 invoked by alias); 19 Jun 2011 19:11:58 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 29495 Received: (qmail 17847 invoked from network); 19 Jun 2011 19:11:56 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.212.43 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=D5W1oNDci4oNuveNBxq7YQh2W1n2fG/sVmad+DDk3xg=; b=xsdobzIJX/kPlIuGeNXeOWEJL7IoFuthGn89rJNfbPlqFEEW9+CLSRyqRXTJ/0dY3o Apph5Pi+O6aA7shpeTsdvmsNtqFkjzKoqnHddIB3hCrY7IIkzDqbAV9n84L7l+wFpGrz sx6ZhoAIhb4zcXm8FToJx+TyqR9GmEFo0JNsA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=izIZMYA7Y/dJVNtM9AHsgmpjyJwVOu0sMCgE0mBBb8+ieQpeL4YR1Dr55GOm5an5uV 99YSgUKW/MFgKOm8EDGY+R3HUtDAOu42d9YE/DTkH/zBggKbFcnRPdkSpOCJ3UTrsP2s qNMdyL4L/0oYi5E7vsmzV97juL8nDaROBpOxw= MIME-Version: 1.0 In-Reply-To: <20110619011826.008ddf41@pws-pc.ntlworld.com> References: <6389.1308441403@pws-pc.ntlworld.com> <20110619011826.008ddf41@pws-pc.ntlworld.com> Date: Sun, 19 Jun 2011 21:05:31 +0200 Message-ID: Subject: Re: PATCH: unused variables From: Mikael Magnusson To: Peter Stephenson Cc: Zsh hackers list Content-Type: text/plain; charset=UTF-8 On 19 June 2011 02:18, Peter Stephenson wrote: > On Sun, 19 Jun 2011 00:56:43 +0100 > Peter Stephenson 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