how do I stop gcjh from generating function bodies?

Tom Tromey tromey@redhat.com
Mon Nov 12 08:28:00 GMT 2001


>>>>> "Adam" == Adam Megacz <gcj@lists.megacz.com> writes:

Adam>   public class C implements I {
Adam>       public I returnSelfAsI() { return this; }
Adam>   }

Adam> ...but gcjh generates a body for it in the .h file, except that CNI
Adam> doesn't grok interfaces, so the generated .h doesn't compile (CNI
Adam> doesn't understand that it's okay to return a C when the declared
Adam> return type is an I).

Interesting -- this case never came up before.
This is a bug in gcjh.
One fix could be to have gcjh cast the return result.

Tom



More information about the Java mailing list