From: Daniel Berger Date: 2003-08-03T06:01:21+09:00 Subject: -Wall cleanup project Hi all, Here are my "patches" to Preview 7 to help cleanup the -Wall warnings for Suse Linux 8.0 with gcc 3.2. Note that the largest offender is eval.c, which often complains with this warning: "variable `some_var' might be clobbered by `longjmp' or `vfork'" I tried declaring some of these as volatile just to see what would happen but that seemed to cause more problems. Also, see some comments at the end. # diff bignum.c ../ruby-1.8.0/bignum.c 451c451 < while ((c = *str++)) { --- > while (c = *str++) { # diff dir.c ../ruby-1.8.0/dir.c 155c155 < while ((c = *pat++)) { --- > while (c = *pat++) { # diff eval.c ../ruby-1.8.0/eval.c 1098c1098 < if ((tail = memchr(einfo, '\n', elen))) { --- > if (tail = memchr(einfo, '\n', elen)) { 1449c1449 < volatile VALUE result = Qnil; --- > VALUE result; /* OK */ 1585c1585 < VALUE val = Qnil; --- > VALUE val; /* OK */ 1630c1630 < VALUE val = Qnil; --- > VALUE val; /* OK */ 3660c3660 < VALUE result = Qnil; --- > VALUE result; /* OK */ 4500c4500 < while ((eclass = va_arg(args, VALUE))) { --- > while (eclass = va_arg(args, VALUE)) { 4597c4597 < VALUE result = Qnil; --- > VALUE result; /* OK */ 5555c5555 < VALUE val = Qnil; --- > VALUE val; /* OK */ 7413c7413 < VALUE result = Qnil; --- > VALUE result; /* OK */ 7959c7959 < VALUE val = Qnil; --- > VALUE val; /* OK */ 10063c10063 < VALUE val = Qnil; --- > VALUE val; /* OK */ linux:/usr/local/src/ruby-1.8.0nowarn # # diff marshal.c ../ruby-1.8.0/marshal.c 478c478 < if ((ivtbl = rb_generic_ivar_table(obj))) { --- > if (ivtbl = rb_generic_ivar_table(obj)) { # diff process.c ../ruby-1.8.0/process.c 626,627c626,627 < if ((*a++ = strtok(ss, " \t"))) { < while ((t = strtok(NULL, " \t"))) { --- > if (*a++ = strtok(ss, " \t")) { > while (t = strtok(NULL, " \t")) { # diff re.c ../ruby-1.8.0/re.c 82c82 < if ((tmp = casetable[(unsigned)*p1++] - casetable[(unsigned)*p2++])) --- > if (tmp = casetable[(unsigned)*p1++] - casetable[(unsigned)*p2++]) # diff ruby.c ../ruby-1.8.0/ruby.c 195c195 < if ((s = strchr(p, sep))) { --- > if (s = strchr(p, sep)) { 385c385 < if ((p = strchr(s, '='))) { --- > if (p = strchr(s, '=')) { 834c834 < if ((p = strstr(RSTRING(line)->ptr, "ruby"))) { --- > if (p = strstr(RSTRING(line)->ptr, "ruby")) { 886c886 < if ((p = strstr(p, " -"))) { --- > if (p = strstr(p, " -")) { # diff struct.c ../ruby-1.8.0/struct.c 217c217 < while ((mem = va_arg(ar, char*))) { --- > while (mem = va_arg(ar, char*)) { Other notes =========== The process.c file still gives me these warnings: process.c: In function `rb_syswait': process.c:840: warning: `hfunc' might be used uninitialized in this function process.c:840: warning: `qfunc' might be used uninitialized in this function process.c:840: warning: `ifunc' might be used uninitialized in this function process.c: In function `proc_getpgid': process.c:1081: warning: implicit declaration of function `getpgid' process.c: In function `p_sys_setresuid': process.c:1236: warning: implicit declaration of function `setresuid' process.c: In function `p_sys_setresgid': process.c:1471: warning: implicit declaration of function `setresgid' I am not sure why it's giving me "implicit declaration" warnings when it appears that unistd.h is being included at the top of the header. Could #ifdef HAVE_UNISTD_H #include #endif be failing somehow? The config log seems to indicate that unistd.h was detected, so I don't see why it should be failing. Other warnings: =============== parse.y:4443: warning: `nodeline' defined but not used regex.c:2572: warning: `insert_op' defined but not used regex.c:1000: warning: `print_compiled_pattern' defined but not used Can we remove these functions? That's all for now. Regards, Dan __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com