The following patch cleans up some 700+ warnings on my Solaris 8/gcc-2.8 system. I've bundled them all together since they are (I hope) non-controversial.
Two hunks merit special mention: The first is removing -ansi -pendantic, which I ranted about yesterday, and is necessary to apply to get anywhere at all. The second is classes/pmc2c.pl. I now have things like default.c include their relevant header files, e.g. default.h. A dependency issue could eventually arise as header files are needed before they are built, but that's a problem for another day, I think. Patch and enjoy, diff -r -u parrot/Configure.pl parrot-andy/Configure.pl --- parrot/Configure.pl Tue Jan 15 10:08:15 2002 +++ parrot-andy/Configure.pl Wed Jan 16 09:39:51 2002 @@ -393,7 +393,7 @@ my @opt_and_vers = - (0 => "-Wall -ansi -pedantic -Wstrict-prototypes -Wmissing-prototypes -Winline -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Waggregate-return -Winline -W -Wsign-compare -Wno-unused", + (0 => "-Wall -Wstrict-prototypes -Wmissing-prototypes -Winline -Wshadow +-Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion +-Waggregate-return -Winline -W -Wsign-compare -Wno-unused", # others; ones we might like marked with ? # ? -Wundef for undefined idenfiers in #if # ? -Wbad-function-cast diff -r -u parrot/classes/pmc2c.pl parrot-andy/classes/pmc2c.pl --- parrot/classes/pmc2c.pl Thu Jan 3 21:29:18 2002 +++ parrot-andy/classes/pmc2c.pl Wed Jan 16 10:57:04 2002 @@ -228,7 +228,12 @@ my $includes = ''; foreach my $class (keys %visible_supers) { - next if $class eq $classname; + # This used to be + # next if $class eq $classname; + # But most files (e.g. default.c) should include their own headers + # (e.g. default.h). I'm not sure what this was attempting to + # guard against, so I've left this comment in as a reminder. + # -- A.D. 1/2002. $includes .= qq(#include "\L$class.h"\n); } @@ -243,6 +248,9 @@ unless (exists $flags{noinit}) { my $initline = 1+count_newlines($OUT)+1; $OUT .= qq(#line $initline "$cfile"\n) unless $suppress_lines; + $HOUT .= <<EOH; +void $initname (void); +EOH $OUT .= <<EOC; void $initname (void) { diff -r -u parrot/key.c parrot-andy/key.c --- parrot/key.c Tue Jan 15 10:08:16 2002 +++ parrot-andy/key.c Wed Jan 16 10:08:21 2002 @@ -26,14 +26,14 @@ debug_key (struct Parrot_Interp* interpreter, KEY* key) { INTVAL i; fprintf(stderr," *** key %p\n",key); - fprintf(stderr," *** size %d\n",key->size); + fprintf(stderr," *** size " INTVAL_FMT "\n",key->size); for(i=0;i<key->size;i++) { INTVAL type = key->keys[i].type; if(type == enum_key_bucket) { - fprintf(stderr," *** Bucket %d type %d\n",i,type); + fprintf(stderr," *** Bucket " INTVAL_FMT " type " INTVAL_FMT "\n",i,type); } else if(type != enum_key_undef) { - fprintf(stderr," *** Other %d type %d\n",i,type); + fprintf(stderr," *** Other " INTVAL_FMT " type " INTVAL_FMT "\n",i,type); } } } diff -r -u parrot/runops_cores.c parrot-andy/runops_cores.c --- parrot/runops_cores.c Tue Jan 15 10:08:17 2002 +++ parrot-andy/runops_cores.c Wed Jan 16 10:27:28 2002 @@ -45,7 +45,7 @@ INTVAL code_size; opcode_t * code_end; opcode_t * lastpc = NULL; - FLOATVAL time = 0; + FLOATVAL starttime = 0; code_start = (opcode_t *)interpreter->code->byte_code; code_size = interpreter->code->byte_code_size; @@ -59,7 +59,7 @@ if (interpreter->flags & PARROT_PROFILE_FLAG) { interpreter->profile[*pc].numcalls++; lastpc=pc; - time=Parrot_floatval_time(); + starttime=Parrot_floatval_time(); } DO_OP(pc, interpreter); @@ -68,7 +68,7 @@ trace_op(interpreter, code_start, code_end, pc); } if (interpreter->flags & PARROT_PROFILE_FLAG) { - interpreter->profile[*lastpc].time += Parrot_floatval_time() - time; + interpreter->profile[*lastpc].time += Parrot_floatval_time() - starttime; } } diff -r -u parrot/test_main.c parrot-andy/test_main.c --- parrot/test_main.c Tue Jan 15 10:08:21 2002 +++ parrot-andy/test_main.c Wed Jan 16 09:54:30 2002 @@ -246,7 +246,7 @@ unsigned int j; int op_count = 0; int call_count = 0; - FLOATVAL time = 0.0; + FLOATVAL tottime = 0.0; printf("Operation profile:\n\n"); @@ -257,7 +257,7 @@ if(interpreter->profile[j].numcalls > 0) { op_count++; call_count += interpreter->profile[j].numcalls; - time += interpreter->profile[j].time; + tottime += interpreter->profile[j].time; printf(" %5d %-12s %12ld %5.6f %5.6f\n", j, interpreter->op_info_table[j].full_name, @@ -274,8 +274,8 @@ op_count, "", call_count, - time, - time / (FLOATVAL)call_count + tottime, + tottime / (FLOATVAL)call_count ); } } -- Andy Dougherty [EMAIL PROTECTED] Dept. of Physics Lafayette College, Easton PA 18042