develooper Front page | perl.perl5.porters | Postings from June 2012

[perl #112776] Uninitialized value $ExtUtils::ParseXS::num in subtraction

Thread Next
From:
Father Chrysostomos via RT
Date:
June 19, 2012 21:58
Subject:
[perl #112776] Uninitialized value $ExtUtils::ParseXS::num in subtraction
Message ID:
rt-3.6.HEAD-5009-1340168281-1489.112776-15-0@perl.org
On Tue May 08 06:34:12 2012, tonyc wrote:
> On Tue, May 08, 2012 at 10:13:58AM +0100, Nicholas Clark wrote:
> > On Tue, May 08, 2012 at 07:47:48AM +0200, Steffen Mueller wrote:
> > > On 05/06/2012 05:58 AM, Christopher J. Madsen via RT wrote:
> > > > On Sat May 05 20:53:41 2012, jkeenan wrote:
> > > >> Please review the patch attached.
> > > >
> > > > Well, I can confirm that it solves my problem, but I don't know
enough
> > > > about ExtUtils::ParseXS to be sure it's the right solution, or
if it's
> > > > just masking the real problem.
> > > 
> > > That is precisely why I hadn't included a simple change like the 
> > > proposed patch yet -- I am also not entirely certain about whether
it's 
> > > a fix or just plaster. Jim's finding of key (var name) mismatches
does 
> > > make it sound like there's a deeper issue.
> > > 
> > > I'm on the fence on whether it's better to apply the patch to avoid 
> > > confusing users or whether it's better not to in the hope that one of 
> > > the affected users cares as much as Christopher and figures it out. 
> > > Alas, I don't currently have the time to dig in myself.
> > 
> > I fear that it's plaster, and hence applying it does nothing to
solve the
> > actual problem.
> 
> There's one or both of two problems here:
> 
> a) the generated Build forces $^W on, which isn't the normal state
> when the code is run within xsubpp
> 
> b) the undefined value itself is caused because the:
> 
>         const char *	s = SvPV(sv, len);
> 
> in const-xs.inc is for a name that isn't a parameter.
> 
> I can produce the same warning with code like:
> 
> #include "EXTERN.h"
> #include "perl.h"
> #include "XSUB.h"
> 
> #include "ppport.h"
> 
> MODULE = Foo  PACKAGE = Foo  PREFIX = LIBMTP_
> 
> PROTOTYPES: DISABLE
> 
> void
> foo()
>     const char *s = "world";
>   CODE:
>     printf("hello %s\n", s);
> 
> I suspect the better change would be to change:
> 
>   my $arg = "ST(" . ($num - 1) . ")";
> 
> to something along the lines of:
> 
>     my $arg = $num ? "ST(" . ($num - 1) . ")"
>        : qq(die "$var isn't an argument\\n");

Just a reminder. :-)

-- 

Father Chrysostomos


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

Thread Next


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