Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: More compiler warnings after recent patches
- X-seq: zsh-workers 5761
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: Re: More compiler warnings after recent patches
- Date: Thu, 11 Mar 1999 17:27:31 +0100 (MET)
- In-reply-to: Bart Schaefer's message of Thu, 11 Mar 1999 08:15:03 -0800 (PST)
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
Bart Schaefer wrote:
> Thanks for the quick reply on the options.c thing ... here's more:
>
> ../../../zsh-3.1.5/Src/Zle/compctl.c: In function `parse_cmatcher':
> ../../../zsh-3.1.5/Src/Zle/compctl.c:186: warning: `r' might be used uninitialized in this function
> ... [ more of that...]
In all cases the variables couldn't be used uninitialised. It was just
that the compiler tried to be clever, and...
Bye
Sven
diff -u os/Zle/compctl.c Src/Zle/compctl.c
--- os/Zle/compctl.c Thu Mar 11 14:31:01 1999
+++ Src/Zle/compctl.c Thu Mar 11 17:26:07 1999
@@ -183,7 +183,7 @@
static Cmatcher
parse_cmatcher(char *name, char *s)
{
- Cmatcher ret = NULL, r, n;
+ Cmatcher ret = NULL, r = NULL, n;
Cpattern line, word, left, right;
int fl, ll, wl, lal, ral, err;
@@ -276,8 +276,10 @@
n->right = right;
n->ralen = ral;
- if (ret) r->next = n;
- else ret = n;
+ if (ret)
+ r->next = n;
+ else
+ ret = n;
r = n;
}
@@ -290,7 +292,7 @@
static Cpattern
parse_pattern(char *name, char **sp, int *lp, char e, int *err)
{
- Cpattern ret = NULL, r, n;
+ Cpattern ret = NULL, r = NULL, n;
unsigned char *s = (unsigned char *) *sp;
int l = 0;
@@ -1707,6 +1709,7 @@
}
for (p = *argv + 1; *p; p++) {
sp = NULL;
+ e = NULL;
dm = 0;
switch (*p) {
case 'q':
@@ -2229,7 +2232,7 @@
if (comp_check()) {
char *s, **p;
int i, l = arrlen(compwords), t = 0, b = 0, e = l - 1;
- Comp c;
+ Comp c = NULL;
i = compcurrent - 1;
if (i < 0 || i >= l)
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author