Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zle_thingy.c: variable "modsave" used before its value set
- X-seq: zsh-users 7335
- From: Wayne Davison <wayned@xxxxxxxxxxxxxxxxxxxxx>
- To: Jens Petersen <petersen@xxxxxxxxxx>
- Subject: Re: zle_thingy.c: variable "modsave" used before its value set
- Date: Mon, 12 Apr 2004 02:04:36 -0700
- Cc: Zsh users list <zsh-users@xxxxxxxxxx>, d.binderman@xxxxxxxxxx
- In-reply-to: <m34qrqgemf.wl%petersen@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <1087.1079112181@xxxxxxx> <m34qrqgemf.wl%petersen@xxxxxxxxxx>
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..
--- 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);
}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author