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;