From: Rafael Garcia-Suarez Date: Wed, 16 Oct 2002 18:43:21 +0000 (+0000) Subject: prototype() didn't warn when used in void context. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=78e1b766412138639765560ca379489ded0446bf;p=p5sagit%2Fp5-mst-13.2.git prototype() didn't warn when used in void context. p4raw-id: //depot/perl@18020 --- diff --git a/op.c b/op.c index c589fce..4d1f7a2 100644 --- a/op.c +++ b/op.c @@ -725,6 +725,7 @@ Perl_scalarvoid(pTHX_ OP *o) case OP_GGRNAM: case OP_GGRGID: case OP_GETLOGIN: + case OP_PROTOTYPE: func_ops: if (!(o->op_private & (OPpLVAL_INTRO|OPpOUR_INTRO))) useless = OP_DESC(o); diff --git a/t/lib/warnings/op b/t/lib/warnings/op index 1e39c0e..c5f8147 100644 --- a/t/lib/warnings/op +++ b/t/lib/warnings/op @@ -298,6 +298,7 @@ eval { getgrnam 1 }; # OP_GGRNAM eval { getgrgid 1 }; # OP_GGRGID eval { getpwnam 1 }; # OP_GPWNAM eval { getpwuid 1 }; # OP_GPWUID +prototype "foo"; # OP_PROTOTYPE EXPECT Useless use of repeat (x) in void context at - line 3. Useless use of wantarray in void context at - line 5. @@ -336,6 +337,7 @@ Useless use of getgrnam in void context at - line 50. Useless use of getgrgid in void context at - line 51. Useless use of getpwnam in void context at - line 52. Useless use of getpwuid in void context at - line 53. +Useless use of subroutine prototype in void context at - line 54. ######## # op.c use warnings 'void' ; close STDIN ; @@ -398,6 +400,7 @@ eval { getgrnam 1 }; # OP_GGRNAM eval { getgrgid 1 }; # OP_GGRGID eval { getpwnam 1 }; # OP_GPWNAM eval { getpwuid 1 }; # OP_GPWUID +prototype "foo"; # OP_PROTOTYPE EXPECT ######## # op.c