perlbug-followup at perl
Jun 19, 2012, 9:58 PM
Post #1 of 1
On Tue May 08 06:34:12 2012, tonyc wrote:
[perl #112776] Uninitialized value $ExtUtils::ParseXS::num in subtraction
> 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
> > > > about ExtUtils::ParseXS to be sure it's the right solution, or
> > > > 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
> > > a fix or just plaster. Jim's finding of key (var name) mismatches
> > > 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
> > 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
> const char *s = "world";
> 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. :-)
via perlbug: queue: perl5 status: open