From: Nick Ing-Simmons Date: Thu, 12 Aug 1999 19:17:20 +0000 (+0000) Subject: Turn of deprecated warnings for defined(@Sompack::ISA) type X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7e291ef107a151a0b630a8ce85d6a562438da741;p=p5sagit%2Fp5-mst-13.2.git Turn of deprecated warnings for defined(@Sompack::ISA) type tests i.e. RV2AV and RV2HV p4raw-id: //depot/perl@3970 --- diff --git a/op.c b/op.c index 9f92232..7d8ee8b 100644 --- a/op.c +++ b/op.c @@ -5046,6 +5046,7 @@ Perl_ck_defined(pTHX_ OP *o) /* 19990527 MJD */ if ((o->op_flags & OPf_KIDS) && ckWARN(WARN_DEPRECATED)) { switch (cUNOPo->op_first->op_type) { case OP_RV2AV: + break; /* Globals via GV can be undef */ case OP_PADAV: case OP_AASSIGN: /* Is this a good idea? */ Perl_warner(aTHX_ WARN_DEPRECATED, @@ -5054,6 +5055,7 @@ Perl_ck_defined(pTHX_ OP *o) /* 19990527 MJD */ "(Maybe you should just omit the defined()?)\n"); break; case OP_RV2HV: + break; /* Globals via GV can be undef */ case OP_PADHV: Perl_warner(aTHX_ WARN_DEPRECATED, "defined(%hash) is deprecated"); diff --git a/t/pragma/warn/op b/t/pragma/warn/op index 2377066..b5d2e71 100644 --- a/t/pragma/warn/op +++ b/t/pragma/warn/op @@ -89,13 +89,11 @@ defined(@array) is deprecated (Maybe you should just omit the defined()?) - defined @a ; my @a ; defined @a ; defined (@a = (1,2,3)) ; defined(%hash) is deprecated (Maybe you should just omit the defined()?) - defined %h ; my %h ; defined %h ; Mandatory Warnings @@ -739,13 +737,6 @@ Statement unlikely to be reached at - line 4. ######## # op.c use warning 'deprecated' ; -defined(@a); -EXPECT -defined(@array) is deprecated at - line 3. -(Maybe you should just omit the defined()?) -######## -# op.c -use warning 'deprecated' ; my @a; defined(@a); EXPECT defined(@array) is deprecated at - line 3. @@ -760,13 +751,6 @@ defined(@array) is deprecated at - line 3. ######## # op.c use warning 'deprecated' ; -defined(%h); -EXPECT -defined(%hash) is deprecated at - line 3. -(Maybe you should just omit the defined()?) -######## -# op.c -use warning 'deprecated' ; my %h; defined(%h); EXPECT defined(%hash) is deprecated at - line 3.