zsh-workers
 help / color / mirror / code / Atom feed
* Re: PATCH: 3.1.6-pre-1: remove variable warnings
@ 1999-07-19  6:34 Sven Wischnowsky
  0 siblings, 0 replies; 2+ messages in thread
From: Sven Wischnowsky @ 1999-07-19  6:34 UTC (permalink / raw)
  To: zsh-workers


Wayne Davison wrote:

> I tweaked the code to remove two warnings about potential uses of
> variables before they were defined.  I'm not sure if the first one
> (for "cl" in complistmatches()) should be initialized to -1 or 0,
> so I chose -1.

Oops. -1 is fine. Thanks. (Why does gcc complain about uninitialised
variables only when compiling with optimisation? Grrr.)

Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 2+ messages in thread

* PATCH: 3.1.6-pre-1: remove variable warnings
@ 1999-07-18  0:09 Wayne Davison
  0 siblings, 0 replies; 2+ messages in thread
From: Wayne Davison @ 1999-07-18  0:09 UTC (permalink / raw)
  To: Zsh Workers

I tweaked the code to remove two warnings about potential uses of
variables before they were defined.  I'm not sure if the first one
(for "cl" in complistmatches()) should be initialized to -1 or 0,
so I chose -1.  The initialization of "buf" (in getkeystring()) does
not appear to be required (upon casual inspection), but doesn't hurt.

..wayne..
---8<------8<------8<------8<---cut here--->8------>8------>8------>8---
Index: Src/Zle/complist.c
@@ -309,7 +309,7 @@
     Cexpl *e;
     int nlines = 0, ncols, nlist = 0, longest = 1, pnl = 0, opl = 0;
     int of = isset(LISTTYPES);
-    int mc, ml = 0, cc, hasm = 0, cl;
+    int mc, ml = 0, cc, hasm = 0, cl = -1;
     struct listcols col;
 
     if (minfo.asked == 2) {
Index: Src/utils.c
@@ -3202,7 +3202,7 @@
     int meta = 0, control = 0;
 
     if (fromwhere == 6)
-	t = tmp;
+	t = buf = tmp;
     else if (fromwhere != 4)
 	t = buf = zhalloc(strlen(s) + 1);
     else {
---8<------8<------8<------8<---cut here--->8------>8------>8------>8---


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-07-19  6:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-07-19  6:34 PATCH: 3.1.6-pre-1: remove variable warnings Sven Wischnowsky
  -- strict thread matches above, loose matches on Subject: below --
1999-07-18  0:09 Wayne Davison

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).