From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13344 invoked from network); 12 Apr 2004 09:05:00 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 12 Apr 2004 09:05:00 -0000 Received: (qmail 24151 invoked by alias); 12 Apr 2004 09:04:41 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7335 Received: (qmail 24138 invoked from network); 12 Apr 2004 09:04:40 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 12 Apr 2004 09:04:40 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [130.225.247.86] by sunsite.dk (MessageWall 1.0.8) with SMTP; 12 Apr 2004 9:4:40 -0000 Received: (qmail 9573 invoked from network); 12 Apr 2004 09:04:39 -0000 Received: from dsl3-63-249-88-2.cruzio.com (HELO binome.blorf.net) (63.249.88.2) by a.mx.sunsite.dk with SMTP; 12 Apr 2004 09:04:38 -0000 Received: by binome.blorf.net (Postfix, from userid 1000) id 85CA22A48; Mon, 12 Apr 2004 02:04:36 -0700 (PDT) Date: Mon, 12 Apr 2004 02:04:36 -0700 From: Wayne Davison To: Jens Petersen Cc: Zsh users list , d.binderman@virgin.net Subject: Re: zle_thingy.c: variable "modsave" used before its value set Message-ID: <20040412090436.GC28460@blorf.net> References: <1087.1079112181@csr.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="mYCpIKhGyMATD0i+" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.5.1+cvs20040105i X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=0.0 required=6.0 tests=none autolearn=no version=2.63 X-Spam-Hits: 0.0 --mYCpIKhGyMATD0i+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Apr 12, 2004 at 10:38:00AM +0900, Jens Petersen wrote: > I received a bug report that the local variable `modsave' is > used uninitialised in bin_zle_call() (zle_thingy.c). The variable can't actually be used uninitialized -- the compiler just thinks it can. If we want to get rid of the warning, I'd recommend making the struct static rather than initializing it to an unneeded value on every call. Here's a patch that does this, plus it gets rid of some unneeded cleanup code that can't get triggered. ..wayne.. --mYCpIKhGyMATD0i+ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="modsave.patch" --- Src/Zle/zle_thingy.c 12 Dec 2003 22:53:28 -0000 1.12 +++ Src/Zle/zle_thingy.c 12 Apr 2004 08:40:04 -0000 @@ -622,13 +622,11 @@ static int bin_zle_call(char *name, char **args, Options ops, char func) { Thingy t; - struct modifier modsave; + static struct modifier modsave; int ret, saveflag = 0; char *wname = *args++; if (!wname) { - if (saveflag) - zmod = modsave; return (!zleactive || incompctlfunc || incompfunc || sfcontext != SFC_WIDGET); } --mYCpIKhGyMATD0i+--