This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
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 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| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |