Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: pws-21: uninitialized variables



It looks like the complaint about a variable in add_match_data()
being potentially used uninitialized is valid, so this patch sets
qisl to 0.

The complaints about 4 variables in sep_comp_string() being
potentially used uninitialized appear to be bogus, but I like to get
rid of warnings, so I added initializations for them as well.

..wayne..

---8<------8<------8<------8<---cut here--->8------>8------>8------>8---
Index: Src/Zle/zle_tricky.c
--- zsh-3.1.5-pws-21/Src/Zle/zle_tricky.c	Tue Jun  8 00:30:29 1999
+++ ./Src/Zle/zle_tricky.c	Tue Jun  8 18:25:39 1999
@@ -3427,7 +3427,7 @@
     Aminfo ai = (alt ? fainfo : ainfo);
     int palen, salen, qipl, ipl, pl, ppl, qisl, isl, psl;
 
-    palen = salen = qipl = ipl = pl = ppl = isl = psl = 0;
+    palen = salen = qipl = ipl = pl = ppl = qisl = isl = psl = 0;
 
     DPUTS(!line, "BUG: add_match_data() without cline");
 
@@ -4914,6 +4914,9 @@
     int sl = strlen(ss), tl, got = 0, i = 0, cur = -1, oll = ll;
     int ois = instring, oib = inbackt;
     char *tmp, *p, *ns, *ol = (char *) line, sav, oaq = autoq, *qp, *qs;
+
+    swb = swe = soffs = 0;
+    ns = NULL;
 
     /* Put the string in the lexer buffer and call the lexer to *
      * get the words we have to expand.                        */
---8<------8<------8<------8<---cut here--->8------>8------>8------>8---



Messages sorted by: Reverse Date, Date, Thread, Author