[Expat-discuss] Expat 2.0 pre-release

rolf@pointsman.de rolf at pointsman.de
Fri Dec 23 19:29:10 CET 2005


Hi Karl,

thanks for pushing things - we need someone like this! (And sorry for
my slowness :-( .)

On 23 Dec, Karl Waclawek wrote:
> I have posted another pre-release distribution snapshot 
> <http://www.libexpat.org/expat-2005-12-23.tar.gz> of the code currently 
> in CVS on libexpat.org. Please try this out and report any problems you 
> have. We'd like to get Expat 2.0 out soon.
> 
> A late addition was the new (optional) |XML_LARGE_SIZE| feature to 
> enable 64-bit integers on some API members. Please check how it builds 
> and works for you.

The pre-release has at least the small problem, that the new signature
of the changed XML_Get* functions need other *printf output
conversions. 

On linux, gcc 3.3, with

./configure CPPFLAGS=-DXML_LARGE_SIZE

I get this warnings

gcc -I./lib -I. -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions -DHAVE_EXPAT_CONFIG_H  -DXML_LARGE_SIZE -o xmlwf/xmlwf.o -c xmlwf/xmlwf.c
xmlwf/xmlwf.c: In function `metaLocation':
xmlwf/xmlwf.c:312: warning: long int format, different type arg (arg 3)
xmlwf/xmlwf.c:312: warning: int format, different type arg (arg 5)
xmlwf/xmlwf.c:312: warning: int format, different type arg (arg 6)
gcc -I./lib -I. -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions -DHAVE_EXPAT_CONFIG_H  -DXML_LARGE_SIZE -o xmlwf/xmlfile.o -c xmlwf/xmlfile.c
xmlwf/xmlfile.c: In function `reportError':
xmlwf/xmlfile.c:60: warning: int format, different type arg (arg 4)
xmlwf/xmlfile.c:60: warning: int format, different type arg (arg 5)


On linux, for xmlwf.c

  ftprintf((FILE *)XML_GetUserData(parser),
           T(" byte=\"%lld\" nbytes=\"%d\" line=\"%lld\" col=\"%lld\""),
           XML_GetCurrentByteIndex(parser),
           XML_GetCurrentByteCount(parser),
           XML_GetCurrentLineNumber(parser),
           XML_GetCurrentColumnNumber(parser));

and for xmlfile.c

    ftprintf(stdout, T("%s:%lld:%lld: %s\n"),
             filename,
             XML_GetErrorLineNumber(parser),
             XML_GetErrorColumnNumber(parser),
             message);

seems to do the trick (note the %lld conversion - I think, %Ld would
also work). Unfortunately, it's not that easy. There are at least ll,
L, q and, IIRC, I64 (windows) as long long formated output conversion
syntax, AFAIK. I'm afraid, we need another define, say XML_LL_MODIFIER
to be used in that expat sample programs as

    ftprintf(stdout, T("%s:%" XML_LL_MODIFIER "d:%" XML_LL_MODIFIER "d: %s\n"),

Not really beautiful, but probably inevitably.

I wonder, why I don't see any define for XML_LARGE_SIZE to __int64
under windows. As far as I know, at least VC++ 6.0 don't know long
long, but has __int64 (you're much more the expert on this plattform,
so please enlighten me, if I miss the obvious). If I'm right (I doubt
it), then XML_LARGE_SIZE support under windows would be only possible
after editing expat_external.h

rolf





More information about the Expat-discuss mailing list