Hi,

I'd like to make vcl compilable without warnings on Mac OS X and I found something that I do not know how to fix properly...

/Users/pavel/BUILD/X11/BuildDir/ooo_SRC680_m199_src/vcl/source/app/ svapp.cxx:1715: warning: control may reach end of non-void function 'BOOL KeyCode::IsDefinedKeyCodeEqual(const KeyCode&) const' being inlined

This function is defined as:

inline BOOL KeyCode::IsDefinedKeyCodeEqual( const KeyCode& rKeyCode ) const
{
if ( (eFunc == KEYFUNC_DONTKNOW) && (rKeyCode.eFunc == KEYFUNC_DONTKNOW) )
                return (GetFullKeyCode() == rKeyCode.GetFullKeyCode());
        else
                return (GetFunction() == rKeyCode.GetFunction());
}

And in fact the compiler is telling me now that control may reach end of it. Strange, but true ;-) This is a compiler bug, same/relevant to:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21191
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19699

The question is what to do with it and with my goal to make it warning free ;-)

The compiler is gcc version 4.0.1 (Apple Computer, Inc. build 5367).

I see several "fixes" to this:

- adding return FALSE; at the end of the inline function

- removing "else"

What solution is the best for you? Do you have cleaner solution for this?
--
Pavel Janík
[EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to