Re: [xml] Warnings on LibXML

Date view Thread view Subject view Author view

From: David Doolin (doolin@cs.utk.edu)
Date: Mon Sep 25 2000 - 12:23:05 EDT


In message <20000925161536.D9442@w3.org>, Daniel Veillard writes:
>
>On Mon, Sep 25, 2000 at 10:39:05AM -0300, Nilo S. Mismetti wrote:
>> Daniel,
>>
>> We use LibXML under (sorry) MS VC 6.0 and we need to fix some constructs
>> that cause this compiler to issue warnings. Those fixes are cosmetic but..
>>
>> Attached are the patches.
>
> Okay, I think they are not relative to 2.2.3, I have tried to integrate
>them anyway. Also providing contextual patches makes my life easier.
>
>> BTW: What compiler is used to develop libxml? This compiler does not
>> generate those warnings?
>
>I usually stick to:
> gcc -Wall -pedantic -O2 -g
>
> Gnu C compile with all warnings enabled.

gcc does not appear to warn on unsigned/signed comparisons.

Supposedly, sun cc catches as well. I have no opinion on whether these
should be considered as "real warnings", and I am almost ready
to #pragma them away for my own purposes.

Dave D

of >
>> *HTMLparser.c
>> 1254c1254
>> < if (html40EntitiesTable[i].value == c) {
>> ---
>> > if ((unsigned int)html40EntitiesTable[i].value == c) {
>> 1260c1260
>> < if (html40EntitiesTable[i].value > c)
>> ---
>> > if ((unsigned int)html40EntitiesTable[i].value > c)
>> 2673c2673
>> < atts = (const xmlChar **) xmlRealloc(atts, maxatts * sizeof(xm
>lChar *));
>> ---
>> > atts = (const xmlChar **) xmlRealloc((void *) atts, maxatts *
>sizeof(xmlChar *));
>> *parser.c
>> 7876c7876
>> < atts = (const xmlChar **) xmlRealloc(atts,
>> ---
>> > atts = (const xmlChar **) xmlRealloc((void *) atts,
>> 7929c7929
>> < xmlFree(atts);
>> ---
>> > xmlFree((void *) atts);
>
> Okay ... I don't really understand why MSC is unhappy there, but this
>should not be a problem.
>
>> *tree.c
>> 3946c3946
>> < if (len > buf->use) return(-1);
>> ---
>> > if (len > (int)(buf->use)) return(-1);
>
> I rather changed the signature to
> xmlBufferShrink(xmlBufferPtr buf, unsigned int len)
>
>> 3969c3969
>> < if (len <= buf->use) return(0);
>> ---
>> > if (len <= (int) (buf->use)) return(0);
>
> Same here
> xmlBufferGrow(xmlBufferPtr buf, unsigned int len)
>
>> 4057c4057
>> < if(size < buf->size)
>> ---
>> > if(size < (int) buf->size)
>> 4120c4120
>> < if(needSize > buf->size){
>> ---
>> > if(needSize > (int) buf->size){
>> 4165c4165
>> < if(needSize > buf->size){
>> ---
>> > if(needSize > (int) buf->size){
>
> Okay I have tried to clean them up too, by by changing
>stuff to unsigned int where required.
>
> thanks for the patch,
>
>Daniel
>
>--
>Daniel.Veillard@w3.org | W3C, INRIA Rhone-Alpes | Today's Bookmarks :
>Tel : +33 476 615 257 | 655, avenue de l'Europe | Linux XML libxml WWW
>Fax : +33 476 615 207 | 38330 Montbonnot FRANCE | Gnome rpm2html rpmfind
> http://www.w3.org/People/all#veillard%40w3.org | RPM badminton Kaffe
>----
>Message from the list xml@rpmfind.net
>Archived at : http://xmlsoft.org/messages/
>to unsubscribe: echo "unsubscribe xml" | mail majordomo@rpmfind.net

----
Message from the list xml@rpmfind.net
Archived at : http://xmlsoft.org/messages/
to unsubscribe: echo "unsubscribe xml" | mail  majordomo@rpmfind.net


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Mon Sep 25 2000 - 12:44:17 EDT