develooper Front page | perl.perl5.porters | Postings from April 2001

[PATCH t/comp/proto.t] disable correct warning

Thread Next
From:
Robin Houston
Date:
April 26, 2001 08:09
Subject:
[PATCH t/comp/proto.t] disable correct warning
Message ID:
20010426160934.A27140@puffinry.freeserve.co.uk
t/comp/proto.t disables the wrong warning. The only reason it works
is because of the rather odd way that "no warnings" will behave if
lexical warnings were not previously enabled: it will disable *all*
warnings.

The patch below means that you can run
./perl -Ilib -Mwarnings t/comp/proto.t
and *still* not get spurious warnings.

 .robin.

--- t/comp/proto.t.orig Thu Apr 26 16:05:39 2001
+++ t/comp/proto.t      Thu Apr 26 16:06:17 2001
@@ -492,7 +492,7 @@
 # string "parse error".
 #
 for my $p ( "", qw{ () ($) ($@) ($%) ($;$) (&) (&\@) (&@) (%) (\%) (\@) } ) {
-  no warnings 'redefine';
+  no warnings 'prototype';
   my $eval = "sub evaled_subroutine $p { &void *; }";
   eval $eval;
   print "# eval[$eval]\nnot " unless $@ && $@ =~ /(parse|syntax) error/i;


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About