Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the YAML CPAN distribution.

Report information
The Basics
Id: 90847
Status: resolved
Priority: 0/
Queue: YAML

People
Owner: Nobody in particular
Requestors: zefram [...] fysh.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: warnings from inc/Test/Builder.pm
Date: Wed, 27 Nov 2013 08:02:39 +0000
To: bug-YAML [...] rt.cpan.org
From: Zefram <zefram [...] fysh.org>
Testing YAML on 5.19.6 gives many of these warnings: Possible precedence issue with control flow operator at /opt/perl-5.19.6/cpan/build/YAML-0.86-TyyhBK/inc/Test/Builder.pm line 917. It's referring to code in _is_dualvar(), physically line 628: return $numval != 0 and $numval ne $val ? 1 : 0; which actually returns the truth value arising from $numval!=0; everything after the "and" is unreachable. -zefram
On Wed Nov 27 03:02:53 2013, zefram@fysh.org wrote: Show quoted text
> Testing YAML on 5.19.6 gives many of these warnings: > > Possible precedence issue with control flow operator at /opt/perl- > 5.19.6/cpan/build/YAML-0.86-TyyhBK/inc/Test/Builder.pm line 917. > > It's referring to code in _is_dualvar(), physically line 628: > > return $numval != 0 and $numval ne $val ? 1 : 0; > > which actually returns the truth value arising from $numval!=0; > everything > after the "and" is unreachable. > > -zefram
So this? return ($numval != 0 and $numval ne $val) ? 1 : 0; Could you possibly test that for me and maybe give a PR if it fixes it?
Subject: Re: [rt.cpan.org #90847] warnings from inc/Test/Builder.pm
Date: Wed, 27 Nov 2013 16:38:48 +0000
To: Ingy dot Net via RT <bug-YAML [...] rt.cpan.org>
From: Zefram <zefram [...] fysh.org>
Ingy dot Net via RT wrote: Show quoted text
>Could you possibly test that for me
$ /opt/perl-5.19.6/bin/perl -we 'sub a { my($numval, $val); return $numval != 0 and $numval ne $val ? 1 : 0; }' Possible precedence issue with control flow operator at -e line 1. $ /opt/perl-5.19.6/bin/perl -we 'sub a { my($numval, $val); return ($numval != 0 and $numval ne $val) ? 1 : 0; }' $ Show quoted text
>and maybe give a PR if it fixes it?
A Github pull request? I don't drink the Github kool-aid. (Also, if I were writing the code, I wouldn't have fixed it that way: I'd s/and/&&/.) -zefram
fixed in 0.87 just needed latest Test::Builder in inc/

Funnily enough, this was actually fixed in 0.85, then later unfixed in 0.86, then refixed in 0.87

0.85 -> 0.87 shows no code differences in Builder.pm

https://metacpan.org/diff/release/INGY/YAML-0.85/INGY/YAML-0.87#inc/Test/Builder.pm


0.85 -> 0.86 shows lots of code diffences and a TB downgrade

https://metacpan.org/diff/release/INGY/YAML-0.85/INGY/YAML-0.86#inc/Test/Builder.pm

0.86 -> 0.87 shows lots of differences and a TB upgrade.
 

https://metacpan.org/diff/release/INGY/YAML-0.86/INGY/YAML-0.87#inc/Test/Builder.pm

 

Also, was previously reported as such.