diff options
author | Mike Guy <mjtg@cam.ac.uk> | 2001-04-25 19:31:47 +0100 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-04-25 16:37:26 +0000 |
commit | 960b42539bbb489e5a078c4ee6ab12205929606c (patch) | |
tree | 3632a5d3fe149a92cddb7f2cf975f6f262ca6c76 /op.c | |
parent | c391288ee8b21c2943cf54621dec7bf8811a0517 (diff) | |
download | perl-960b42539bbb489e5a078c4ee6ab12205929606c.tar.gz |
Re: Useless use of constants other than 0,1 in void context?
Message-Id: <E14sT8l-0004IE-00@libra.cus.cam.ac.uk>
p4raw-id: //depot/perl@9838
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -1137,6 +1137,9 @@ Perl_scalarvoid(pTHX_ OP *o) else { if (ckWARN(WARN_VOID)) { useless = "a constant"; + /* the constants 0 and 1 are permitted as they are + conventionally used as dummies in constructs like + 1 while some_condition_with_side_effects; */ if (SvNIOK(sv) && (SvNV(sv) == 0.0 || SvNV(sv) == 1.0)) useless = 0; else if (SvPOK(sv)) { |