summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorRobin Houston <robin@cpan.org>2001-04-02 16:03:29 +0100
committerJarkko Hietaniemi <jhi@iki.fi>2001-04-03 13:11:46 +0000
commit936edb8bce14c9708bc6198559047de5d7e6af47 (patch)
tree56418e45ab38e385bc4cd7ab1edf78f3c4007654 /op.c
parent31f187ae5b4b937f1c4319a89e6fd6f99121320a (diff)
downloadperl-936edb8bce14c9708bc6198559047de5d7e6af47.tar.gz
Re: [ID 20010331.003] new misc warning for push(@x), unshift(@x)
Message-ID: <20010402150329.A6636@puffinry.freeserve.co.uk> p4raw-id: //depot/perl@9532
Diffstat (limited to 'op.c')
-rw-r--r--op.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/op.c b/op.c
index 155f107b1f..44a19d3122 100644
--- a/op.c
+++ b/op.c
@@ -5679,6 +5679,12 @@ Perl_ck_fun(pTHX_ OP *o)
list(kid);
break;
case OA_AVREF:
+ if ((type == OP_PUSH || type == OP_UNSHIFT)
+ && !kid->op_sibling && ckWARN(WARN_MISC))
+ Perl_warner(aTHX_ WARN_MISC,
+ "Useless use of %s with no arguments",
+ PL_op_desc[type]);
+
if (kid->op_type == OP_CONST &&
(kid->op_private & OPpCONST_BARE))
{