Skip Menu |
 

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

Report information
The Basics
Id: 73905
Status: resolved
Priority: 0/
Queue: XML-LibXSLT

People
Owner: Nobody in particular
Requestors: StephenW.Adcock [...] NRCan-RNCan.gc.ca
Cc:
AdminCc:

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



Subject: LibXSLT will not compile with Microsoft C compiler
Date: Wed, 11 Jan 2012 17:40:16 -0500
To: <bug-XML-LibXSLT [...] rt.cpan.org>
From: "Adcock, Stephen W" <StephenW.Adcock [...] NRCan-RNCan.gc.ca>
Download (untitled) / with headers
text/plain 1.4k
XML::LibXSLT-1.75 Perl v5.14.2 MS Windows Server 2008 R2, with Visual Studio 2010 (fully patched) There are two places in LibXSLT.xs where code precedes declarations. This, of course, is quite valid with C99, but Microsoft's C compiler still does not support C99. The compilation fails with the misleading error "C2275: illegal use of this type as an expression". The changes to LibXSLT.xs, to make it msvc-compatible, are trivial: 1. Lines 268 to 289 (in LibXSLT__function): const char * cls = "XML::LibXML::Node"; xmlNodePtr tnode = NULL; SV * element = NULL; int i; for(i=0; i < nodelist->nodeNr; i++ ){ tnode = nodelist->nodeTab[i]; /* need to copy the node as libxml2 will free it */ if (tnode->type == XML_NAMESPACE_DECL) { element = sv_newmortal(); cls = x_PmmNodeTypeName( tnode ); element = sv_setref_pv( element, (const char *)cls, (void *)xmlCopyNamespace((xmlNsPtr)tnode) ); } else { xmlNodePtr tnode_cpy = xmlDocCopyNode(tnode,INT2PTR(xmlDocPtr,x_PmmNODE(SvPROXYNODE(owner_doc)) ),1); if( tnode_cpy == NULL ) break; element = x_PmmNodeToSv(tnode_cpy,SvPROXYNODE(owner_doc)); } XPUSHs( sv_2mortal(element) ); Enclose the lines in curly brackets, and optionally reverse the logic of the "if ..." statement on lines266-7. 2. Line 541 (in LibXSLT_context_element): dSP; Move the dSP macro up to the beginning of the function. Cheers, Steve Adcock Geochemist Geological Survey of Canada
Download (untitled) / with headers
text/html 12.8k

Message body is not shown because it is too large.

Download (untitled) / with headers
text/plain 440b
Hi Stephen, I don't have access to Microsoft Visual Studio (though I can try installing the free version on my Windows 7 x86-64 partition). Can you download and install Mercurial and run «hg clone https://bitbucket.org/shlomif/perl-xml-libxslt», then cd into perl-xml-libxslt, apply your changes, get the sources to compile and then attach the output of «hg diff» here? Maybe read a short Mercurial tutorial. Regards, -- Shlomi Fish
Subject: RE: [rt.cpan.org #73905] LibXSLT will not compile with Microsoft C compiler
Date: Thu, 12 Jan 2012 09:15:49 -0500
To: <bug-XML-LibXSLT [...] rt.cpan.org>
From: "Adcock, Stephen W" <StephenW.Adcock [...] NRCan-RNCan.gc.ca>
Download (untitled) / with headers
text/plain 833b
OK. I will be out of the office for the next few days, but will try to do this sometime next week. Cheers, Steve Show quoted text
-----Original Message----- From: Shlomi Fish via RT [mailto:bug-XML-LibXSLT@rt.cpan.org] Sent: January-12-12 2:33 AM To: Adcock, Stephen W Subject: [rt.cpan.org #73905] LibXSLT will not compile with Microsoft C compiler <URL: https://rt.cpan.org/Ticket/Display.html?id=73905 > Hi Stephen, I don't have access to Microsoft Visual Studio (though I can try installing the free version on my Windows 7 x86-64 partition). Can you download and install Mercurial and run <hg clone https://bitbucket.org/shlomif/perl-xml-libxslt>, then cd into perl-xml-libxslt, apply your changes, get the sources to compile and then attach the output of <hg diff> here? Maybe read a short Mercurial tutorial. Regards, -- Shlomi Fish
Download (untitled) / with headers
text/plain 875b
On Thu Jan 12 02:32:58 2012, SHLOMIF wrote: Show quoted text
> I don't have access to Microsoft Visual Studio (though I can try > installing the free version on my Windows 7 x86-64 partition).
Hi, Shlomi. I'm afraid don't have access to Visual Studio either, but AFAICT, the only thing causing compilation problems under VS is mixed declarations and statements. If you're using GCC 4.4 or newer for development, you can force that to be an error by compiling with `make CC='gcc -Werror=declaration-after-statement'`. If that's an option for you, I suspect it would help avoid things like this accidentally getting into releases in the future. (In versions of GCC before 4.4, there's a bug which means this option just gives you a warning instead of the error you asked for, so it doesn't prevent compilation. That might also help, but it's clearly not as good.) Hope this helps.
Download (untitled) / with headers
text/plain 1.1k
On Thu Jan 12 10:48:56 2012, ARC wrote: Show quoted text
> On Thu Jan 12 02:32:58 2012, SHLOMIF wrote:
> > I don't have access to Microsoft Visual Studio (though I can try > > installing the free version on my Windows 7 x86-64 partition).
> > Hi, Shlomi. I'm afraid don't have access to Visual Studio either, but > AFAICT, the only thing > causing compilation problems under VS is mixed declarations and > statements. If you're using > GCC 4.4 or newer for development, you can force that to be an error by > compiling with `make > CC='gcc -Werror=declaration-after-statement'`. If that's an option > for you, I suspect it would > help avoid things like this accidentally getting into releases in the > future. > > (In versions of GCC before 4.4, there's a bug which means this option > just gives you a warning > instead of the error you asked for, so it doesn't prevent compilation. > That might also help, but > it's clearly not as good.) > > Hope this helps.
Thanks! I did what you say and gcc complained about some errors which I've fixed. The changes are in XML-LibXSLT-1.76 which was just uploaded to CPAN. Please test. Regards, -- Shlomi Fish
Subject: RE: [rt.cpan.org #73905] LibXSLT will not compile with Microsoft C compiler
Date: Mon, 16 Jan 2012 13:14:56 -0500
To: <bug-XML-LibXSLT [...] rt.cpan.org>
From: "Adcock, Stephen W" <StephenW.Adcock [...] NRCan-RNCan.gc.ca>
Download (untitled) / with headers
text/plain 1.4k
Tested with v1.76, and it works perfectly. Many thanks! Steve Adcock Show quoted text
-----Original Message----- From: Shlomi Fish via RT [mailto:bug-XML-LibXSLT@rt.cpan.org] Sent: January-12-12 12:35 PM To: Adcock, Stephen W Subject: [rt.cpan.org #73905] LibXSLT will not compile with Microsoft C compiler <URL: https://rt.cpan.org/Ticket/Display.html?id=73905 > On Thu Jan 12 10:48:56 2012, ARC wrote:
> On Thu Jan 12 02:32:58 2012, SHLOMIF wrote:
> > I don't have access to Microsoft Visual Studio (though I can try > > installing the free version on my Windows 7 x86-64 partition).
> > Hi, Shlomi. I'm afraid don't have access to Visual Studio either, but > AFAICT, the only thing > causing compilation problems under VS is mixed declarations and > statements. If you're using > GCC 4.4 or newer for development, you can force that to be an error by > compiling with `make > CC='gcc -Werror=declaration-after-statement'`. If that's an option > for you, I suspect it would > help avoid things like this accidentally getting into releases in the > future. > > (In versions of GCC before 4.4, there's a bug which means this option > just gives you a warning > instead of the error you asked for, so it doesn't prevent compilation. > That might also help, but > it's clearly not as good.) > > Hope this helps.
Thanks! I did what you say and gcc complained about some errors which I've fixed. The changes are in XML-LibXSLT-1.76 which was just uploaded to CPAN. Please test. Regards, -- Shlomi Fish
Download (untitled) / with headers
text/plain 1.7k
On Mon Jan 16 13:15:09 2012, StephenW.Adcock@NRCan-RNCan.gc.ca wrote: Show quoted text
> Tested with v1.76, and it works perfectly. > Many thanks! > Steve Adcock >
You're welcome and thanks for reporting it. So I'm resolving this ticket. Please don't respond as this will reopen it. Regards, Shlomi Fish Show quoted text
> -----Original Message----- > From: Shlomi Fish via RT [mailto:bug-XML-LibXSLT@rt.cpan.org] > Sent: January-12-12 12:35 PM > To: Adcock, Stephen W > Subject: [rt.cpan.org #73905] LibXSLT will not compile with Microsoft C > compiler > > <URL: https://rt.cpan.org/Ticket/Display.html?id=73905 > > > On Thu Jan 12 10:48:56 2012, ARC wrote:
> > On Thu Jan 12 02:32:58 2012, SHLOMIF wrote:
> > > I don't have access to Microsoft Visual Studio (though I can try > > > installing the free version on my Windows 7 x86-64 partition).
> > > > Hi, Shlomi. I'm afraid don't have access to Visual Studio either, but > > AFAICT, the only thing > > causing compilation problems under VS is mixed declarations and > > statements. If you're using > > GCC 4.4 or newer for development, you can force that to be an error by > > compiling with `make > > CC='gcc -Werror=declaration-after-statement'`. If that's an option > > for you, I suspect it would > > help avoid things like this accidentally getting into releases in the > > future. > > > > (In versions of GCC before 4.4, there's a bug which means this option > > just gives you a warning > > instead of the error you asked for, so it doesn't prevent compilation. > > That might also help, but > > it's clearly not as good.) > > > > Hope this helps.
> > Thanks! I did what you say and gcc complained about some errors which > I've fixed. The changes are in XML-LibXSLT-1.76 which was just uploaded > to CPAN. Please test. > > Regards, > > -- Shlomi Fish > >


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.