[PATCH] dom_string valgrinf warning

Luciano Montanaro mikelima at virgilio.it
Fri Jul 4 14:25:07 BST 2003


On Friday 04 July 2003 11:36, Dirk Mueller wrote:
> On Don, 03 Jul 2003, Luciano Montanaro wrote:
> > +    if ( l != bs.length() ) return true;
> >      int l = as.length();
>
> Did you even compile it or check if your patch fixes anything? Which
> compiler accepts undeclared variables?
>

Oops! I sent the wrong patch. I compiled and tested the patch before sending 
it, but I had a wrong diff around. Sorry for the confusion.

> Furthermore, when I look at the code, I see this in the very first line of
> the method:
>
> bool DOM::strcasecmp( const DOMString &as, const DOMString &bs )
> {
>     if ( as.length() != bs.length() ) return true;

I see. I overlooked that. However, what is strange is that with the patch 
(well, the one where the test follows the declaration, that is), Valgrind 
seems happy. The second line of the patch does not seem really needed too.
if *bs is 0 the test should return anyway.

So, I'll have to do more testing... May that be due to some gcc optimization?

Luciano




More information about the kfm-devel mailing list