khtml/dom compiler warning

Michael Pyne michael.pyne at kdemail.net
Sun Jan 22 08:56:04 GMT 2006


On Sunday 22 January 2006 03:36, André Wöbbeking wrote:
> Hi,
>
> I just compiled newest KDE 3.5 branch with GCC 4.0.2 and got:
>
> khtml/dom/dom2_events.cpp: In member function 'void
> DOM::TextEvent::initTextEvent(const DOM::DOMString&, bool, bool, const
> DOM::AbstractView&, long int, const DOM::DOMString&, long unsigned int,
> long unsigned int, bool, bool)': khtml/dom/dom2_events.cpp:546: warning:
> 'impl' is used uninitialized in this function
> khtml/dom/dom2_events.cpp:549: warning: 'impl' is used uninitialized in
> this function
>
> and this is the code:
>
>         TextEventImpl* impl = static_cast<TextEventImpl*>(impl);
>         impl->initTextEvent(typeArg, canBubbleArg, cancelableArg, viewArg,
> text); } else {
>         KeyboardEventImpl* impl = static_cast<KeyboardEventImpl*>(impl);
>
> I don't know if  Bla* impl = impl is valid code but at least GCC 4 seems
> to don't like it.

It is valid code, and gcc is mistaken in this case.

7 lines above is an if test:
    if (impl->isTextInputEvent()) {

which doesn't get flagged by gcc as suspicious by your error report for some 
reason.  Perhaps it's a gcc bug?

Regards,
 - Michael Pyne




More information about the kfm-devel mailing list