From: Wayne Davison <wayned@users.sourceforge.net>
To: Zsh Workers <zsh-workers@sunsite.dk>
Subject: A few compiler warnings
Date: Tue, 7 Aug 2001 16:51:25 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.33L2.0108071641480.18512-100000@phong.blorf.net> (raw)
The following patch silences a few compiler warnings.
The first hunk sets "n" to NULL in bld_parts(). This isn't required
by the code, but gcc isn't smart enough to figure out that "n" can't
be used uninitialized.
The second hunk removes 3 unused variables.
The third hunk silences 3 "might be used uninitialized" warnings, but
someone who knows the code in cd_get() should look at it and see if
there is a better fix (such as making one of the other switch-case
sections the "default:", or returning an error).
I haven't committed any of this yet, though the second hunk is really
a no-brainer. Comments?
..wayne..
---8<------8<------8<------8<---cut here--->8------>8------>8------>8---
Index: Src/Zle/compmatch.c
--- Src/Zle/compmatch.c 2001/06/27 13:18:39 1.36
+++ Src/Zle/compmatch.c 2001/08/07 19:33:00
@@ -1129,7 +1129,7 @@
Cline
bld_parts(char *str, int len, int plen, Cline *lp)
{
- Cline ret = NULL, *q = &ret, n;
+ Cline ret = NULL, *q = &ret, n = NULL;
Cmlist ms;
Cmatcher mp;
int t, op = plen;
Index: Src/Zle/compresult.c
--- Src/Zle/compresult.c 2001/07/27 12:56:57 1.40
+++ Src/Zle/compresult.c 2001/08/07 19:33:01
@@ -1520,7 +1520,7 @@
}
if (!onlyexpl) {
char **pp;
- int *ws, tlines, tline, tcols, maxlen, nth, width, glines;
+ int *ws, tlines, tcols, width, glines;
for (g = amatches; g; g = g->next) {
add = 2 + !!(g->flags & CGF_FILES);
Index: Src/Zle/computil.c
--- Src/Zle/computil.c 2001/07/30 08:42:56 1.71
+++ Src/Zle/computil.c 2001/08/07 19:33:03
@@ -640,6 +640,11 @@
csl = "packed";
}
break;
+
+ default:
+ /* Complain here? Is this impossible? */
+ opts = mats = dpys = NULL;
+ break;
}
setsparam(params[0], ztrdup(csl));
setaparam(params[1], opts);
---8<------8<------8<------8<---cut here--->8------>8------>8------>8---
next reply other threads:[~2001-08-07 23:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-08-07 23:51 Wayne Davison [this message]
2001-08-08 7:26 ` Sven Wischnowsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.33L2.0108071641480.18512-100000@phong.blorf.net \
--to=wayned@users.sourceforge.net \
--cc=zsh-workers@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).