Skip Menu |

This queue is for tickets about the XML-LibXML CPAN distribution.

Report information
The Basics
Id: 23541
Status: resolved
Priority: 0/
Queue: XML-LibXML

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

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



Subject: LibXML.xs uses undefined Newx()
Hello, XML::LibXML 1.62 doesn't compile on Perl 5.8 because LibXML.xs uses the Newx() macro, which isn't to be available in maint-5.8. LibXML.xs: In function 'XS_XML__LibXML__Reader__preservePattern': LibXML.xs:8167: error: syntax error before 'xmlChar' The line 8167 being: Newx(namespaces, last+2, xmlChar*); I've checked that Newx() isn't present in my Perl headers, nor in the ppport.h included in XML::LibXML 1.62 distribution. It is defined in more recent versions though, so you just need to update the ppport.h of your distribution. Having said that, I don't understand how this version compile on some CPAN testers machines as P5Porters have confirmed that Newx() isn't available in maint-5.8. » http://cpantesters.perl.org/show/XML-LibXML.html#XML-LibXML-1.62 Regards, -- Close the world, txEn eht nepO.
From: PAJAS [...] cpan.org
On st 22.lis.2006 05:41:33, SAPER wrote: Show quoted text
> Hello, > > XML::LibXML 1.62 doesn't compile on Perl 5.8 because LibXML.xs uses > the Newx() macro, which isn't to be available in maint-5.8. > > LibXML.xs: In function 'XS_XML__LibXML__Reader__preservePattern': > LibXML.xs:8167: error: syntax error before 'xmlChar' > > The line 8167 being: > Newx(namespaces, last+2, xmlChar*); > > I've checked that Newx() isn't present in my Perl headers, nor in > the ppport.h included in XML::LibXML 1.62 distribution. It is
defined Show quoted text
> in more recent versions though, so you just need to update the
ppport.h Show quoted text
> of your distribution. > > Having said that, I don't understand how this version compile on
some Show quoted text
> CPAN testers machines as P5Porters have confirmed that Newx() isn't > available in maint-5.8. > » http://cpantesters.perl.org/show/XML-LibXML.html#XML-LibXML-1.62 > > Regards,
Can you point me to some thread where P5Porters responded that way? My perlapi says Newx *is* defined, and so does http://perldoc.perl.org/perlapi.html Anyway, it seems to be easily fixed by changing Newx(...) to New(0,...). I made this change in the SubVersion now. I guess perlapi documentation should indicate which macros should XS coders use and if p5p claim we should not be using Newx then I must wonder why they do advertise it instead of the old New macros which are not documented anymore. As for the reason why some people can compile it while you can't: it may be because the Newx macro is only used in the new Reader interface which is skipped if some older version of libxml2 is used. However, I am able to compile XML::LibXML with Reader (and therefore the Newx macro) in it without any problem on 5.8.5 - 5.8.8 on various Linux distributions (SuSE 10.1, FC 3, FC 5, CentOS). -- Petr
Subject: Re: [rt.cpan.org #23541] LibXML.xs uses undefined Newx()
Date: Wed, 22 Nov 2006 14:54:59 +0100
To: bug-XML-LibXML [...] rt.cpan.org
From: Sébastien Aperghis-Tramoni <saper [...] cpan.org>
Show quoted text
> Can you point me to some thread where P5Porters responded that way?
No, I asked on IRC to Rafaël Garcia-Suarez. Show quoted text
> My perlapi says Newx *is* defined, and so does > http://perldoc.perl.org/perlapi.html
Indeed, the doucmentation has changed between 5.8.7 and 5.8.8: » http://search.cpan.org/~nwclark/perl-5.8.7/pod/perlapi.pod#Memory_Management » http://search.cpan.org/~nwclark/perl-5.8.8/pod/perlapi.pod#Memory_Management Show quoted text
> Anyway, it seems to be easily fixed by changing Newx(...) to > New(0,...). I made this change in the SubVersion now.
Or, as I pointed in my previous mail, you can simply update ppport.h. I tried that and it compiled fine on my Perl 5.8.5 and 5.6.x. Show quoted text
> As for the reason why some people can compile it while you can't: it > may be because the Newx macro is only used in the new Reader interface > which is skipped if some older version of libxml2 is used.
Looking further, I saw that most CPAN testers who sent PASS are using 5.8.8 Only one PASS was 5.8.6, and a 5.8.7 failed with the same error than me: » http://nntp.x.perl.org/group/perl.cpan.testers/375695 Show quoted text
> However, I am able to compile XML::LibXML with Reader (and therefore > the Newx macro) in it without any problem on 5.8.5 - 5.8.8 on various > Linux distributions (SuSE 10.1, FC 3, FC 5, CentOS).
Thanks -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.
On st 22.lis.2006 08:55:53, SAPER wrote: Show quoted text
>
> > Can you point me to some thread where P5Porters responded that
way? Show quoted text
> > No, I asked on IRC to Rafaël Garcia-Suarez.
ok, no problem. Show quoted text
> > My perlapi says Newx *is* defined, and so does > > http://perldoc.perl.org/perlapi.html
> > Indeed, the doucmentation has changed between 5.8.7 and 5.8.8: > » http://search.cpan.org/~nwclark/perl- > 5.8.7/pod/perlapi.pod#Memory_Management > » http://search.cpan.org/~nwclark/perl- > 5.8.8/pod/perlapi.pod#Memory_Management >
> > Anyway, it seems to be easily fixed by changing Newx(...) to > > New(0,...). I made this change in the SubVersion now.
> > Or, as I pointed in my previous mail, you can simply update
ppport.h. Show quoted text
> I tried that and it compiled fine on my Perl 5.8.5 and 5.6.x.
I will do that for 1.63, but currently the documentation for Devel::PPPort from Perl 5.8.8 doesn't mention Newx in the list of compatibility macros, so I'll still rather resort to New(0,...). I re-relased XML::LibXML 1.62 as XML-LibXML-1.62001.tar.gz (with Newx replaced), so I'm closing this for now. Thanks, -- Petr