problems with installation of XML::LibXML
am 07.06.2005 18:30:05 von Antoine
Hi,
When trying to install XML::LibXML, I get the following error:
perl-libxml-mm.c: In function `nodeC2Sv':
perl-libxml-mm.c:968: parse error before `*'
perl-libxml-mm.c:972: `decoded' undeclared (first use in this function)
perl-libxml-mm.c:972: (Each undeclared identifier is reported only once
perl-libxml-mm.c:972: for each function it appears in.)
make: *** [perl-libxml-mm.o] Error 1
I do understand that there's a problem with declarions in the C code
but i don't have any experience with this language.
Any help on how to fix this problem is very much appreciated.
Antoine
Re: problems with installation of XML::LibXML
am 07.06.2005 19:07:11 von Brian McCauley
antoine wrote:
> Hi,
>
> When trying to install XML::LibXML, I get the following error:
>
> perl-libxml-mm.c: In function `nodeC2Sv':
> perl-libxml-mm.c:968: parse error before `*'
> perl-libxml-mm.c:972: `decoded' undeclared (first use in this function)
> perl-libxml-mm.c:972: (Each undeclared identifier is reported only once
> perl-libxml-mm.c:972: for each function it appears in.)
> make: *** [perl-libxml-mm.o] Error 1
>
> I do understand that there's a problem with declarions in the C code
> but i don't have any experience with this language.
>
> Any help on how to fix this problem is very much appreciated.
Gee, is that still not fixed.
Look at the offending line, you'll see it's trying to do variable
declaration and assignment in one statement (C++ style). Some C
compliers allow this. In strict C all the variable declarations must
come directly after the opening brace of a block. Separate the
statement into a separate declaration and assignment and move the
declaration up to just after the start of the enclosing block.
Since you couldn't be bothered to include the offending code I can't be
bothered to find it either but IIRC its soemthing like the following
pattern..
{
wibble();
foogle *foo = bar();
}
You need to make it
{
foogle *foo;
wibble();
foo = bar();
}
Re: problems with installation of XML::LibXML
am 08.06.2005 14:00:10 von shirsch
This is a multi-part message in MIME format.
--------------000800040001070805060503
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Brian McCauley wrote:
>> When trying to install XML::LibXML, I get the following error:
>>
>> perl-libxml-mm.c: In function `nodeC2Sv':
>> perl-libxml-mm.c:968: parse error before `*'
>> perl-libxml-mm.c:972: `decoded' undeclared (first use in this function)
>> perl-libxml-mm.c:972: (Each undeclared identifier is reported only once
>> perl-libxml-mm.c:972: for each function it appears in.)
>> make: *** [perl-libxml-mm.o] Error 1
> Gee, is that still not fixed.
Apparently not..
> Look at the offending line, you'll see it's trying to do variable
> declaration and assignment in one statement (C++ style). Some C
> compliers allow this. In strict C all the variable declarations must
> come directly after the opening brace of a block. Separate the
> statement into a separate declaration and assignment and move the
> declaration up to just after the start of the enclosing block.
Or, just apply the attached patch.
Steve
--------------000800040001070805060503
Content-Type: text/x-patch;
name="perl-libxml-mm.c.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="perl-libxml-mm.c.patch"
--- perl-libxml-mm.c.orig 2004-03-31 14:32:08.000000000 -0500
+++ perl-libxml-mm.c 2004-08-20 14:42:05.000000000 -0400
@@ -959,15 +959,17 @@
if ( refnode != NULL ) {
xmlDocPtr real_doc = refnode->doc;
if ( real_doc != NULL && real_doc->encoding != NULL ) {
+ xmlChar *decoded;
+
xs_warn( " encode node !!" );
/* The following statement is to handle bad
values set by XML::LibXSLT */
if ( PmmNodeEncoding(real_doc) == XML_CHAR_ENCODING_NONE ) {
PmmNodeEncoding(real_doc) = XML_CHAR_ENCODING_UTF8;
}
- xmlChar * decoded = PmmFastDecodeString( PmmNodeEncoding(real_doc) ,
- (const xmlChar *)string,
- (const xmlChar*)real_doc->encoding);
+ decoded = PmmFastDecodeString( PmmNodeEncoding(real_doc) ,
+ (const xmlChar *)string,
+ (const xmlChar*)real_doc->encoding);
xs_warn( "push decoded string into SV" );
len = xmlStrlen( decoded );
retval = newSVpvn( (const char *)decoded, len );
--------------000800040001070805060503--