Skip Menu |

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

Report information
The Basics
Id: 88155
Status: open
Priority: 0/
Queue: XML-Bare

People
Owner: cpan [...] codechild.com
Requestors: fschlich [...] zedat.fu-berlin.de
Cc:
AdminCc:

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



Subject: tarfile timestamps, compiler warnings
Hi, while packaging version 0.53 of XML-Bare for Debian, I've come across a few issues about which I'd like to let you know: 1) file timestamps in the released tarball are dated 12 September 2013, this is still a few weeks in the future and makes our QA unhappy 2) linking against libm seems to have become unnecessary, while including stdlib.h is necessary on Linux as well (see libm.patch, implicit_declaration_of_free.patch) 3) curatt->value is a char*, but is sometimes used as an int. Wouldn't it be possible to use NULL instead of -1 (see pointer_from_integer.patch; tests pass but I haven't read the code in any depth and may have overlooked something important) Florian
Subject: implicit_declaration_of_free.patch
Description: fix warning "incompatible implicit declaration of built-in function 'free'" by unconditionally including stdlib.h (required on Linux) Author: Florian Schlichting <fsfs@debian.org> --- a/parser.c +++ b/parser.c @@ -1,8 +1,6 @@ #include "parser.h" #include<stdio.h> -#ifdef DARWIN - #include "stdlib.h" -#endif +#include "stdlib.h" #ifdef NOSTRING void memset(char *s, int c, int n) { char *se = s + n;
Subject: libm.patch
Description: do not link against libm unnecessarily (Bare.so uses none of the libraries symbols) Author: Florian Schlichting <fsfs@debian.org> --- a/Makefile.PL +++ b/Makefile.PL @@ -66,7 +66,6 @@ } sub gen_cc { WriteMakefile( @basics, - LIBS => ['-lm'], OBJECT => 'Bare.o parser.o', LDDLFLAGS => '-shared -L/usr/local/lib', );
Subject: libxml-bare-perl_0.53-1_amd64-20130826-2218.build

Message body not shown because it is not plain text.

Subject: pointer_from_integer.patch
Description: fix use of pointer as int fixes "warning: comparison between pointer and integer" and "warning: assignment makes pointer from integer without a cast" compiler warnings Author: Florian Schlichting <fsfs@debian.org> --- a/Bare.xs +++ b/Bare.xs @@ -144,7 +144,7 @@ SV *atthref = newRV_noinc( (SV *) atth ); hv_store( output, curatt->name, curatt->namelen, atthref, 0 ); - if( curatt->value == -1 ) attval = newSVpvn( "1", 1 ); + if( curatt->value == NULL ) attval = newSVpvn( "1", 1 ); else attval = newSVpvn( curatt->value, curatt->vallen ); SvUTF8_on(attval); hv_store( atth, "value", 5, attval, vhash ); @@ -272,7 +272,7 @@ if( numatts ) { curatt = curnode->firstatt; for( i = 0; i < numatts; i++ ) { - if( curatt->value == -1 ) attval = newSVpvn( "1", 1 ); + if( curatt->value == NULL ) attval = newSVpvn( "1", 1 ); else attval = newSVpvn( curatt->value, curatt->vallen ); SvUTF8_on(attval); hv_store( output, curatt->name, curatt->namelen, attval, 0 ); --- a/parser.c +++ b/parser.c @@ -417,7 +417,7 @@ case 0: last_state = ST_att_name; goto done; case '/': // self closing !! /> is assumed !! curatt = nodec_addattr( curnode, attname, attname_len ); - if( !att_has_val ) { curatt->value = -1; curatt->vallen = 0; } + if( !att_has_val ) { curatt->value = NULL; curatt->vallen = 0; } attname_len = 0; curnode->z = cpos+1-xmlin; @@ -436,7 +436,7 @@ goto att_space; case '>': curatt = nodec_addattr( curnode, attname, attname_len ); - if( !att_has_val ) { curatt->value = -1; curatt->vallen = 0; } + if( !att_has_val ) { curatt->value = NULL; curatt->vallen = 0; } attname_len = 0; cpos++; goto val_1; @@ -832,7 +832,7 @@ switch( let ) { case '/': // self closing !! /> is assumed !! curatt = nodec_addattr( curnode, attname, attname_len ); - if( !att_has_val ) { curatt->value = -1; curatt->vallen = 0; } + if( !att_has_val ) { curatt->value = NULL; curatt->vallen = 0; } attname_len = 0; curnode = curnode->parent; @@ -850,7 +850,7 @@ goto u_att_space; case '>': curatt = nodec_addattr( curnode, attname, attname_len ); - if( !att_has_val ) { curatt->value = -1; curatt->vallen = 0; } + if( !att_has_val ) { curatt->value = NULL; curatt->vallen = 0; } attname_len = 0; cpos++; goto u_val_1;
Agreed that the points you have noted are problems. These will be corrected and posted to cpan within the week. Thank you for noting these issues. There is no specific reason to use -1 instead of NULL at this point. I originally coded it that way because on some platforms memory was being blanked to 0 but not on others, so I set to -1 intentionally so that I could test and ensure I was properly initializing everything. On Mon Aug 26 17:37:42 2013, fschlich wrote: Show quoted text
> Hi, > > while packaging version 0.53 of XML-Bare for Debian, I've come across > a few issues about which I'd like to let you know: > > 1) file timestamps in the released tarball are dated 12 September > 2013, this is still a few weeks in the future and makes our QA unhappy > > 2) linking against libm seems to have become unnecessary, while > including stdlib.h is necessary on Linux as well (see libm.patch, > implicit_declaration_of_free.patch) > > 3) curatt->value is a char*, but is sometimes used as an int. Wouldn't > it be possible to use NULL instead of -1 (see > pointer_from_integer.patch; tests pass but I haven't read the code in > any depth and may have overlooked something important) > > Florian