From: Jarkko Hietaniemi Date: Tue, 3 Apr 2001 17:58:07 +0000 (+0000) Subject: Change the push/unshift warning to be of class syntax, not misc. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f87c32135b1a4b7366639f6f0c1ec1a33894905f;p=p5sagit%2Fp5-mst-13.2.git Change the push/unshift warning to be of class syntax, not misc. p4raw-id: //depot/perl@9535 --- diff --git a/op.c b/op.c index 4f95857..f6ec916 100644 --- a/op.c +++ b/op.c @@ -5680,8 +5680,8 @@ Perl_ck_fun(pTHX_ OP *o) break; case OA_AVREF: if ((type == OP_PUSH || type == OP_UNSHIFT) - && !kid->op_sibling && ckWARN(WARN_MISC)) - Perl_warner(aTHX_ WARN_MISC, + && !kid->op_sibling && ckWARN(WARN_SYNTAX)) + Perl_warner(aTHX_ WARN_SYNTAX, "Useless use of %s with no values", PL_op_desc[type]); diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 038b93f..110f1cd 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -3684,7 +3684,7 @@ L for more on this. =item Useless use of %s with no values -(W misc) You used the push() or unshift() function with no arguments +(W syntax) You used the push() or unshift() function with no arguments apart from the array, like C or C. That won't usually have any effect on the array, so is completely useless. It's possible in principle that push(@tied_array) could have some effect diff --git a/t/pragma/warn/op b/t/pragma/warn/op index 62268fc..b4b8e4e 100644 --- a/t/pragma/warn/op +++ b/t/pragma/warn/op @@ -887,10 +887,10 @@ in end ######## # op.c my @x; -use warnings 'misc' ; +use warnings 'syntax' ; push(@x); unshift(@x); -no warnings 'misc' ; +no warnings 'syntax' ; push(@x); unshift(@x); EXPECT