Skip Menu |
 

This queue is for tickets about the XS-Parse-Sublike CPAN distribution.

Report information
The Basics
Id: 132821
Status: patched
Priority: 0/
Queue: XS-Parse-Sublike

People
Owner: Nobody in particular
Requestors: skaji [...] cpan.org
Cc:
AdminCc:

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



Subject: XS-Parse-Sublike with "perl -w" emits warnings
MIME-Version: 1.0
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
Message-ID: <rt-4.0.18-8685-1592218880-1576.0-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 1238
Download (untitled) / with headers
text/plain 1.2k
I sometimes check perl scripts by running "perl -wc script.pl". Currently scripts that use XS::Parse::Sublike emit warnings: ``` ❯ perl -MXS::Parse::Sublike -wce1 Name "XS::Parse::Sublike::REGISTER" used only once: possible typo at /Users/skaji/env/plenv/versions/5.30.3/lib/perl5/5.30.3/XSLoader.pm line 114. Name "XS::Parse::Sublike::ABIVERSION" used only once: possible typo at /Users/skaji/env/plenv/versions/5.30.3/lib/perl5/5.30.3/XSLoader.pm line 114. Name "XS::Parse::Sublike::PARSE" used only once: possible typo at /Users/skaji/env/plenv/versions/5.30.3/lib/perl5/5.30.3/XSLoader.pm line 114. Name "XS::Parse::Sublike::PARSEANY" used only once: possible typo at /Users/skaji/env/plenv/versions/5.30.3/lib/perl5/5.30.3/XSLoader.pm line 114. -e syntax OK ``` It it nice XS::Parse::Sublike suppresses these warnings. An easy way to suppress these warnings seems to add "our" declaration: ``` diff --git lib/XS/Parse/Sublike.pm lib/XS/Parse/Sublike.pm index 620de28..7b16d26 100644 --- lib/XS/Parse/Sublike.pm +++ lib/XS/Parse/Sublike.pm @@ -10,6 +10,11 @@ use warnings; our $VERSION = '0.07'; +our $ABIVERSION; +our $PARSE; +our $REGISTER; +our $PARSEANY; + require XSLoader; XSLoader::load( __PACKAGE__, $VERSION ); ```
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-8685-1592218880-1576.0-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <rt-4.0.18-8685-1592218880-1576.0-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-16024-1592224001-953.132821-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 1251
Download (untitled) / with headers
text/plain 1.2k
Hi, A better fix is actually just to use the `GV_ADDMULTI` flag instead of `GV_ADD`: === modified file 'lib/XS/Parse/Sublike.xs' --- old/lib/XS/Parse/Sublike.xs 2020-06-15 11:22:47 +0000 +++ new/lib/XS/Parse/Sublike.xs 2020-06-15 12:25:44 +0000 @@ -338,9 +338,9 @@ MODULE = XS::Parse::Sublike PACKAGE = XS::Parse::Sublike BOOT: - sv_setiv(get_sv("XS::Parse::Sublike::ABIVERSION", GV_ADD), XSPARSESUBLIKE_ABI_VERSION);- sv_setuv(get_sv("XS::Parse::Sublike::PARSE", GV_ADD), PTR2UV(&IMPL_xs_parse_sublike)); - sv_setuv(get_sv("XS::Parse::Sublike::REGISTER", GV_ADD), PTR2UV(&IMPL_register_xs_parse_sublike)); - sv_setuv(get_sv("XS::Parse::Sublike::PARSEANY", GV_ADD), PTR2UV(&IMPL_xs_parse_sublike_any)); + sv_setiv(get_sv("XS::Parse::Sublike::ABIVERSION", GV_ADDMULTI), XSPARSESUBLIKE_ABI_VERSION); + sv_setuv(get_sv("XS::Parse::Sublike::PARSE", GV_ADDMULTI), PTR2UV(&IMPL_xs_parse_sublike)); + sv_setuv(get_sv("XS::Parse::Sublike::REGISTER", GV_ADDMULTI), PTR2UV(&IMPL_register_xs_parse_sublike)); + sv_setuv(get_sv("XS::Parse::Sublike::PARSEANY", GV_ADDMULTI), PTR2UV(&IMPL_xs_parse_sublike_any)); wrap_keyword_plugin(&my_keyword_plugin, &next_keyword_plugin); That'll be in the next version -- Paul Evans


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.