Re: [xslt] Re: libxml2-2.5.7 and libxslt-1.0.30 -- bugs and patches



On Fri, Jun 13, 2003 at 06:00:04PM +0200, Peter Breitenlohner wrote:
> On Fri, 13 Jun 2003, Daniel Veillard wrote:
> > > @@ -7853,7 +7853,7 @@
> > >  	}
> > >  	xmlRelaxNGFreeStates(ctxt, ctxt->states);
> > >  	ctxt->states = NULL;
> > > -	if ((ret == 0) && (tmp == -1))
> > > +	if (tmp == -1)
> >
> >   I see no justification for that, what compiler warning led you to change
> > that code ? I see no warning with
> >    gcc -DHAVE_CONFIG_H -I. -I. -I. -I./include -I./include -D_REENTRANT -g -O -pedantic -W -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls
> >
> >   Looks to me as change in the semantic, of the code, why ?
> 
> With -O2 you will see that `res' is possibly used uninitialized, and indeed
> all statemants that assign a value to res are inside if-clauses! Maybe my
> patch changes the semantics, but something has to be done here. 'gcc -O2' is
> quite good in giving hints to possibly uninitialized vars and quite often is
> right.

  I still don't understand, for example 5 lines below there is an
    if (ret == 0)
test in another if/else branch ... And I see
    int ret = 0, i, tmp, oldflags, errNr;
as the variable declaration in the xmlRelaxNGValidateState() function,
so no I really don't understand the supposed problem there.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard@redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]