libjava doesn't build with new cp/*

Nathan Sidwell nathan@codesourcery.com
Thu Sep 4 16:56:00 GMT 2003


Michael Matz wrote:

> The error message is correct, because this function reads:
> void
> gnu::java::awt::EmbeddedWindow::setWindowPeer
>   (gnu::java::awt::peer::EmbeddedWindowPeer* w)
> {
>   if (!peer)
>     (::java::lang::Object*) peer = (::java::lang::Object*) w;
> }
> 
> the 'peer' member has type '::java::awt::peer::ComponentPeer *' which has
> no relation to 'gnu::java::awt::peer::EmbeddedWindowPeer*', so just
> removing the casts doesn't work.  Also just removing the left cast doesn't
> work as ::java::lang::Object* can't be converted automatically to
> ::java::awt::peer::ComponentPeer*.  Given this non-relation of the
> involved types I have no idea how this is supposed to work.
given the semantics of cast-is-lvalue extension, I guess
	*(::java::lang::Object**) &peer = (::java::lang::Object*) w;
is what is needed.

nathan

-- 
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
          The voices in my head said this was stupid too
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk




More information about the Gcc mailing list