# New Ticket Created by Jürgen Bömmels # Please include the string: [perl #15907] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=15907 >
Hi, In the quest for removing warnings, I added an option --ccwarn to Configure.pl. With this option I could selectivly turn on and off warnings, and especially compile with -Werror, so I don't miss any warnings. The simple warnings (the missing return values) were already fixed before I was able to submit a patch. One warning was simple to fix: A incompatible pointer assignment in coroutine.pmc The other warnings I found are a little bit more complicated - nonliteral formats in Parrot_vsprintf_s - the return value of invoke needs a cast, but the simple solution, just adding the cast doesn't look right. Maybe change the prototype of invoke. bye boemmels -- attachment 1 ------------------------------------------------------ url: http://rt.perl.org/rt2/attach/32512/26823/c6326a/remove_warnings.diff
? remove_warnings.diff Index: classes/coroutine.pmc =================================================================== RCS file: /cvs/public/parrot/classes/coroutine.pmc,v retrieving revision 1.4 diff -u -r1.4 coroutine.pmc --- classes/coroutine.pmc 26 Jul 2002 19:17:41 -0000 1.4 +++ classes/coroutine.pmc 31 Jul 2002 19:17:39 -0000 @@ -326,7 +326,7 @@ */ INTVAL invoke () { - struct Parrot_Coroutine* co = (struct Parrot_Sub*)SELF->data; + struct Parrot_Coroutine* co = (struct Parrot_Coroutine*)SELF->data; /* Resuming co-routine or fresh call? */ if(!co->resume) { Index: config/auto/gcc.pl =================================================================== RCS file: /cvs/public/parrot/config/auto/gcc.pl,v retrieving revision 1.4 diff -u -r1.4 gcc.pl --- config/auto/gcc.pl 9 Jun 2002 18:06:55 -0000 1.4 +++ config/auto/gcc.pl 31 Jul 2002 19:17:40 -0000 @@ -87,6 +87,13 @@ next unless $opt; # Ignore blank lines $warns .= " $opt"; } + # if the user overwrites the warnings remove it from $warns + if ($cc_warn) { + foreach my $w ( split ' ', $cc_warn ) { + $w =~ s/^-W(?:no-)?(.*)$/$1/; + $warns = join ' ' , grep !/^-W(?:no-)?$w/, split ' ', $warns; + } + } } if (defined $miniparrot && $gccversion) { Index: config/inter/progs.pl =================================================================== RCS file: /cvs/public/parrot/config/inter/progs.pl,v retrieving revision 1.4 diff -u -r1.4 progs.pl --- config/inter/progs.pl 5 Jun 2002 01:59:40 -0000 1.4 +++ config/inter/progs.pl 31 Jul 2002 19:17:40 -0000 @@ -6,7 +6,7 @@ $description = 'Determining what C compiler and linker to use...'; -@args = qw(ask cc ld ccflags ldflags libs debugging); +@args = qw(ask cc ld ccflags ldflags libs debugging ccwarn); sub runstep { my %args; @@ -16,6 +16,7 @@ $ccflags =~ s/-D(PERL|HAVE)_\w+\s*//g; $ldflags =~ s/-libpath:\S+//g; my $debug='n'; + my $cc_warn=''; $libs=join ' ', grep { $^O=~/VMS|MSWin/ || !/^-l(c|gdbm|dbm|ndbm|db)$/ } @@ -27,6 +28,7 @@ $ldflags=$args{ldflags} if defined $args{ldflags}; $libs=$args{libs} if defined $args{libs}; $debug=$args{debugging} if defined $args{debugging}; + $cc_warn=$args{ccwarn} if defined $args{ccwarn}; if($args{ask}) { print <<'END'; @@ -60,7 +62,8 @@ ld => $ld, ccflags => $ccflags, ldflags => $ldflags, - libs => $libs + libs => $libs, + cc_warn => $cc_warn ); } Index: lib/Parrot/Configure/Step.pm =================================================================== RCS file: /cvs/public/parrot/lib/Parrot/Configure/Step.pm,v retrieving revision 1.3 diff -u -r1.3 Step.pm --- lib/Parrot/Configure/Step.pm 19 Jul 2002 08:28:02 -0000 1.3 +++ lib/Parrot/Configure/Step.pm 31 Jul 2002 19:17:40 -0000 @@ -99,7 +99,9 @@ } sub cc_clean { + my $exe=Configure::Data->get('exe'); unlink glob "test.*"; + unlink "test$exe" } 1;
-- Juergen Boemmels [EMAIL PROTECTED] Fachbereich Physik Tel: ++49-(0)631-205-2817 Universitaet Kaiserslautern Fax: ++49-(0)631-205-3906 PGP Key fingerprint = 9F 56 54 3D 45 C1 32 6F 23 F6 C7 2F 85 93 DD 47