khtml/dom compiler warning

Michael Pyne michael.pyne at kdemail.net
Sun Jan 22 11:19:19 GMT 2006


On Sunday 22 January 2006 03:58, André Wöbbeking wrote:
> On Sunday 22 January 2006 09:56, Michael Pyne wrote:
> > It is valid code, and gcc is mistaken in this case.
> >
> > 7 lines above is an if test:
> >     if (impl->isTextInputEvent()) {
>
> impl is a member variable and is shadowed at the mentioned warning. So
> after Bla* impl the new local variable seems to be used instead of the
> member variable. In this case it is used uninitialized.

Yes, you're right.  I'm wrong.  As soon as the second impl is declared, it is 
in scope so the local impl is what gcc tries to cast, instead of the member 
impl.

Damn, that's pretty sneaky too, I probably wouldn't have ever noticed unless 
you had went and completely spelled it out for me. :(

Someday I'll learn to shut up at least until someone else suggests 
something. :)

But yes, this is something that needs fixed.

Regards,
 - Michael Pyne




More information about the kfm-devel mailing list