Re: Expat 2.0 pre-release
Karl Waclawek <[email protected]>
| Newsgroups | gmane.text.xml.expat.general |
|---|---|
| Message-ID | <[email protected]> |
[email protected] wrote: >Hi Karl, > >thanks for pushing things - we need someone like this! (And sorry for >my slowness :-( .) > > Yeah, I thought I just "stelle euch vor vollendete Tatsachen". >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. > > But an internal one, defined by checking XML_LARGE_SIZE, right? Like this, I suppose: #ifdef XML_LARGE_SIZE /* Use large integers for counts and positions. */ typedef long long XML_Index; typedef unsigned long long XML_Size; #define XML_LL_MODIFIER ll #else typedef long XML_Index; typedef unsigned long XML_Size; #define XML_LL_MODIFIER l #endif /* XML_LARGE_SIZE */ I wonder why MS VC++ didn't give me any warnings. >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 > > All later versions of MS VC++ support long long. So I thought: If you are on MSVC++ 6.0 and want to use XML_LARGE_SIZE, its your own fault. Actually, I don't even know how to identify MS VC++ 6.0 at compile time (too lazy to search, I guess). Karl