zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: initialize dparr.
@ 1999-05-05  1:39 Tanaka Akira
  1999-05-05  2:08 ` PATCH: remove warnings from pws 17 Wayne Davison
  0 siblings, 1 reply; 3+ messages in thread
From: Tanaka Akira @ 1999-05-05  1:39 UTC (permalink / raw)
  To: zsh-workers

zsh-3.1.5-pws-17 dumps core with following operation on Solaris7 and gcc-2.8.1.
# --enable-zsh-debug prevents core dump.

Z(2):akr@is27e1u11% Src/zsh  -f
is27e1u11% cat <<'End' > Completion/User/_tst
heredoc> #compdef tst
heredoc> l=(a b)
heredoc> compadd $l
heredoc> End
is27e1u11% fpath=($PWD/Completion/*(/))
is27e1u11% . Completion/Core/compinit 
is27e1u11% tst <TAB>a<TAB>zsh: bus error (core dumped)  Src/zsh -f
Z(2):akr@is27e1u11% 

--- Src/Zle/zle_tricky.c-	Wed May  5 10:23:20 1999
+++ Src/Zle/zle_tricky.c	Wed May  5 10:23:57 1999
@@ -3524,7 +3524,7 @@
 addmatches(Cadata dat, char **argv)
 {
     char *s, *ms, *lipre = NULL, *lisuf = NULL, *lpre = NULL, *lsuf = NULL;
-    char **aign = NULL, **dparr;
+    char **aign = NULL, **dparr = NULL;
     int lpl, lsl, pl, sl, bpl, bsl, llpl = 0, llsl = 0, nm = mnum;
     int oisalt = 0, isalt, isexact, doadd;
     Cline lc = NULL;

-- 
Tanaka Akira


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

* PATCH: remove warnings from pws 17
  1999-05-05  1:39 PATCH: initialize dparr Tanaka Akira
@ 1999-05-05  2:08 ` Wayne Davison
  0 siblings, 0 replies; 3+ messages in thread
From: Wayne Davison @ 1999-05-05  2:08 UTC (permalink / raw)
  To: zsh-workers

Tanaka Akira <akr@jaist.ac.jp> said:
> initialize dparr.

That reminds me -- I generated a small patch that gets rid of all
the warnings in pws 17, and it includes this change.  I've appended
my patch below.  It fixes the following warnings:

 + A ambiguous else warning in rlimits.c fixed by adding braces.

 + comp_setunsetptr in comp1.c was defined as a function pointer
   taking int arguments rather than unsigned ints.

 + **dparr is now initialized to NULL in zle_tricky.c to remove a
   warning about a potential use of dparr without being defined.

 + A variety of #if...#endif lines were flagged with /**/ to remove
   warnings about static functions that get prototyped but not defined.

 + Moved some "#if 0" lines so that they are on the same line as the
   /**/ marker (obsuring it), and thus these undefined functions do
   not get any prototypes.

..wayne..

---8<------8<------8<------8<---cut here--->8------>8------>8------>8---
Index: Src/Builtins/rlimits.c
@@ -43,14 +43,14 @@
 {
     rlim_t ret = 0;
  
-    if (!base)
+    if (!base) {
 	if (*s != '0')
 	    base = 10;
 	else if (*++s == 'x' || *s == 'X')
 	    base = 16, s++;
 	else
 	    base = 8;
- 
+    } 
     if (base <= 10)
 	for (; *s >= '0' && *s < ('0' + base); s++)
 	    ret = ret * base + *s - '0';
Index: Src/Zle/comp1.c
@@ -47,7 +47,7 @@
 void (*makecompparamsptr) _((void));
 
 /**/
-void (*comp_setunsetptr) _((int, int));
+void (*comp_setunsetptr) _((unsigned int, unsigned int));
 
 /* pointers to functions required by compctl and defined by zle */
 
Index: Src/Zle/zle_tricky.c
@@ -3524,7 +3524,7 @@
 addmatches(Cadata dat, char **argv)
 {
     char *s, *ms, *lipre = NULL, *lisuf = NULL, *lpre = NULL, *lsuf = NULL;
-    char **aign = NULL, **dparr;
+    char **aign = NULL, **dparr = NULL;
     int lpl, lsl, pl, sl, bpl, bsl, llpl = 0, llsl = 0, nm = mnum;
     int oisalt = 0, isalt, isexact, doadd;
     Cline lc = NULL;
Index: Src/hashtable.c
@@ -498,6 +498,7 @@
     resizehashtable(ht, ht->hsize);
 }
 
+/**/
 #ifdef ZSH_HASH_DEBUG
 
 /* Print info about hash table */
@@ -550,6 +551,7 @@
     return 0;
 }
 
+/**/
 #endif /* ZSH_HASH_DEBUG */
 
 /********************************/
Index: Src/hist.c
@@ -1362,10 +1362,9 @@
     return 0;
 }
 
-#if 0
 /* read an arbitrary amount of data into a buffer until stop is found */
 
-/**/
+#if 0 /**/
 char *
 hdynread(int stop)
 {
Index: Src/module.c
@@ -142,6 +142,7 @@
     return 0;
 }
 
+/**/
 #ifdef DYNAMIC
 
 /* $module_path ($MODULE_PATH) */
@@ -408,6 +409,7 @@
     return NULL;
 }
 
+/**/
 #ifdef AIXDYNAMIC
 
 /**/
@@ -438,6 +440,7 @@
     return ((int (*)_((int,Module))) m->handle)(3, m);
 }
 
+/**/
 #else
 
 static Module_func
@@ -523,6 +526,7 @@
     return r;
 }
 
+/**/
 #endif /* !AIXDYNAMIC */
 
 /**/
@@ -1097,6 +1101,7 @@
     }
 }
 
+/**/
 #endif /* DYNAMIC */
 
 /* The list of module-defined conditions. */
@@ -1252,6 +1257,7 @@
     return 1;
 }
 
+/**/
 #ifdef DYNAMIC
 
 /* This adds a definition for autoloading a module for a condition. */
@@ -1342,4 +1348,5 @@
     pm->flags |= PM_AUTOLOAD;
 }
 
+/**/
 #endif
Index: Src/params.c
@@ -282,6 +282,7 @@
     return ht;
 }
 
+/**/
 #ifdef DYNAMIC
 /**/
 static HashNode
@@ -299,6 +300,7 @@
     }
     return hn;
 }
+/**/
 #endif /* DYNAMIC */
 
 /* Copy a parameter hash table */
Index: Src/signals.c
@@ -129,10 +129,9 @@
         install_handler(SIGINT);
 }
 
-#if 0
 /* disable ^C interrupts */
  
-/**/
+#if 0 /**/
 void
 nointr(void)
 {
Index: Src/text.c
@@ -72,10 +72,9 @@
     tptr += sl;
 }
 
-#if 0
 /* add an integer to the text buffer */
 
-/**/
+#if 0 /**/
 void
 taddint(int x)
 {
Index: Src/utils.c
@@ -209,10 +209,9 @@
     return buf;
 }
 
-#if 0
 /* Output a string's visible representation. */
 
-/**/
+#if 0 /**/
 void
 nicefputs(char *s, FILE *f)
 {
@@ -3343,10 +3342,9 @@
     return ret;
 }
 
-#if 0
 /* Unmetafy and output a string, double quoting it in its entirety. */
 
-/**/
+#if 0 /**/
 int
 dquotedzputs(char const *s, FILE *stream)
 {
---8<------8<------8<------8<---cut here--->8------>8------>8------>8---


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

* Re: PATCH: remove warnings from pws 17
@ 1999-05-05  6:37 Sven Wischnowsky
  0 siblings, 0 replies; 3+ messages in thread
From: Sven Wischnowsky @ 1999-05-05  6:37 UTC (permalink / raw)
  To: zsh-workers


Wayne Davison wrote:

> Tanaka Akira <akr@jaist.ac.jp> said:
> > initialize dparr.
> 
> ...
>  + comp_setunsetptr in comp1.c was defined as a function pointer
>    taking int arguments rather than unsigned ints.
> 
>  + **dparr is now initialized to NULL in zle_tricky.c to remove a
>    warning about a potential use of dparr without being defined.

Ugh. Sorry. And thanks to Tanaka Akira and you.

Bye
 Sven


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


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

end of thread, other threads:[~1999-05-05  6:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-05-05  1:39 PATCH: initialize dparr Tanaka Akira
1999-05-05  2:08 ` PATCH: remove warnings from pws 17 Wayne Davison
1999-05-05  6:37 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).