* Re: More compiler warnings after recent patches
@ 1999-03-11 16:27 Sven Wischnowsky
0 siblings, 0 replies; only message in thread
From: Sven Wischnowsky @ 1999-03-11 16:27 UTC (permalink / raw)
To: zsh-workers
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@informatik.hu-berlin.de
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1999-03-11 16:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-03-11 16:27 More compiler warnings after recent patches Sven Wischnowsky
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).