rurban / Cpanel-JSON-XS

Improved fork of JSON-XS

Home Page:http://search.cpan.org/dist/Cpanel-JSON-XS/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remaining warnings with newer perls and JSON::PP

ntyni opened this issue · comments

Thanks, 4.32 fixed the JSON::PP warnings (#200) where Cpanel::JSON::XS is used last. This no longer warns:

$ /opt/perl/bin/perl5.37.3 -w -e 'use JSON::PP; use Cpanel::JSON::XS ()'

However, the other way around still warns with 4.32:

$ /opt/perl/bin/perl5.37.3 -w -e 'use Cpanel::JSON::XS (); use JSON::PP
'
Subroutine JSON::PP::Boolean::(0+ redefined at /opt/perl/lib/5.37.3/overload.pm line 52.
Subroutine JSON::PP::Boolean::(-- redefined at /opt/perl/lib/5.37.3/overload.pm line 52.
Subroutine JSON::PP::Boolean::(++ redefined at /opt/perl/lib/5.37.3/overload.pm line 52.

Also, there's a bunch of other warnings when importing:

$ /opt/perl/bin/perl5.37.3 -w -e 'use JSON::PP; use Cpanel::JSON::XS'
Subroutine main::encode_json redefined at /opt/perl/lib/5.37.3/Exporter.pm line 63.
 at -e line 1.
Prototype mismatch: sub main::encode_json ($) vs ($;$) at /opt/perl/lib/5.37.3/Exporter.pm line 63.
 at -e line 1.
Subroutine main::decode_json redefined at /opt/perl/lib/5.37.3/Exporter.pm line 63.
 at -e line 1.
Prototype mismatch: sub main::decode_json: none vs ($;$$) at /opt/perl/lib/5.37.3/Exporter.pm line 63.
 at -e line 1.
Subroutine main::to_json redefined at /opt/perl/lib/5.37.3/Exporter.pm line 63.
 at -e line 1.
Prototype mismatch: sub main::to_json ($) vs ($@) at /opt/perl/lib/5.37.3/Exporter.pm line 63.
 at -e line 1.
Subroutine main::from_json redefined at /opt/perl/lib/5.37.3/Exporter.pm line 63.
 at -e line 1.
Prototype mismatch: sub main::from_json ($) vs ($@) at /opt/perl/lib/5.37.3/Exporter.pm line 63.
 at -e line 1.
$ /opt/perl/bin/perl5.37.3 -w -e 'use Cpanel::JSON::XS; use JSON::PP'
Subroutine JSON::PP::Boolean::(0+ redefined at /opt/perl/lib/5.37.3/overload.pm line 52.
Subroutine JSON::PP::Boolean::(++ redefined at /opt/perl/lib/5.37.3/overload.pm line 52.
Subroutine JSON::PP::Boolean::(-- redefined at /opt/perl/lib/5.37.3/overload.pm line 52.
Subroutine main::encode_json redefined at /opt/perl/lib/5.37.3/Exporter.pm line 63.
 at -e line 1.
Prototype mismatch: sub main::encode_json ($;$) vs ($) at /opt/perl/lib/5.37.3/Exporter.pm line 63.
 at -e line 1.
Subroutine main::decode_json redefined at /opt/perl/lib/5.37.3/Exporter.pm line 63.
 at -e line 1.
Prototype mismatch: sub main::decode_json ($;$$) vs none at /opt/perl/lib/5.37.3/Exporter.pm line 63.
 at -e line 1.
Subroutine main::from_json redefined at /opt/perl/lib/5.37.3/Exporter.pm line 63.
 at -e line 1.
Prototype mismatch: sub main::from_json ($@) vs ($) at /opt/perl/lib/5.37.3/Exporter.pm line 63.
 at -e line 1.
Subroutine main::to_json redefined at /opt/perl/lib/5.37.3/Exporter.pm line 63.
 at -e line 1.
Prototype mismatch: sub main::to_json ($@) vs ($) at /opt/perl/lib/5.37.3/Exporter.pm line 63.
 at -e line 1.

Hmm, I cannot do anything against the other way round.
Is this a regression?

The RT5 test suite now passes for me with Cpanel::JSON::XS 4.32 on Perl 5.36, so our main concern is resolved. Thanks again for that. I just noticed the other warnings while testing things out.

The import warnings are not a regression. I see them with older perls (at least 5.32 and 5.34) as well. Sorry for not checking that.

These warnings are a remaining regression on newer perls:

$ /opt/perl/bin/perl5.37.3 -w -e 'use Cpanel::JSON::XS(); use JSON::PP'
Subroutine JSON::PP::Boolean::(-- redefined at /opt/perl/lib/5.37.3/overload.pm line 52.
Subroutine JSON::PP::Boolean::(0+ redefined at /opt/perl/lib/5.37.3/overload.pm line 52.
Subroutine JSON::PP::Boolean::(++ redefined at /opt/perl/lib/5.37.3/overload.pm line 52.

Should they rather be reported on the JSON::PP side?

Yes please. I cannot do anything