From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3069 invoked from network); 7 Aug 2001 23:52:06 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 7 Aug 2001 23:52:06 -0000 Received: (qmail 10655 invoked by alias); 7 Aug 2001 23:51:54 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 15596 Received: (qmail 10643 invoked from network); 7 Aug 2001 23:51:53 -0000 Date: Tue, 7 Aug 2001 16:51:25 -0700 (PDT) From: Wayne Davison X-X-Sender: To: Zsh Workers Subject: A few compiler warnings Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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---