develooper Front page | perl.perl5.porters | Postings from May 2019

[perl #134032] Devel::PPPort makes incorrect suggestion for changingPerl_filter_read

From:
Karl Williamson via RT
Date:
May 9, 2019 20:57
Subject:
[perl #134032] Devel::PPPort makes incorrect suggestion for changingPerl_filter_read
Message ID:
rt-4.0.24-6260-1557435432-400.134032-15-0@perl.org
On Tue, 23 Apr 2019 18:56:18 -0700, tonyc wrote:
> On Sun, 14 Apr 2019 11:15:27 -0700, karen@froods.org wrote:
> > A while ago I applied some changes to B::Hooks::Parser as suggested
> > by
> > ppport.h:
> >
> > https://github.com/karenetheridge/B-Hooks-
> > Parser/commit/66a934c02168048cebeb5a95d6ad3bbbe6e8f707
> >
> > ..and then yesterday released as
> > https://metacpan.org/release/ETHER/B-Hooks-Parser-0.20.
> >
> > This failed on threaded builds:
> > https://rt.cpan.org/Ticket/Display.html?id=129173
> 
> I expect the output from ppport.h is intended for callers of the perl
> API filter_read() rather than for code that tries to redefine it.
> 
> Calling the filter_read() macro instead of using Perl_filter_read() is
> good advice for callers of filter_read(), I don't think it's necessary
> for it to deal with the hopefully much less common case of code that
> tries to redefine perl API functions.
> 
> Tony

I've studied this more, and I agree with Tony.  I'm thinking this ticket should be rejected.

The problem is that this is using stolen core code, which is a situation we want to avoid, and should be quite rare.  And I don't think it's worth enhancing ppport to handle this unlikely case.  I looked at its code, and it does handle the case of a call to such a function, noting the aTHX_, and including its removal in the suggestion.  But it has no current way of coping with a function definition which uses pTHX_ instead.  If someone wanted to undertake doing this, I'd be happy to accept their pull request.  But there are much more important things to spend one's time on.
-- 
Karl Williamson

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=134032



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About