[kaffe] kaffe: different compilers giving different results for the same source file

Rogério Brito rbrito at ime.usp.br
Wed Aug 4 20:02:19 PDT 2004


Hi, everybody.

And thanks Ito Kazumitsu for replying to my original message. I would also
like to apologize for messing up with the Debian BTS. :-(

On Aug 04 2004, Ito Kazumitsu wrote:
> I think KJC, Kaffe's compiler is wrong.
> 
> The problem is that KJC accepts the expression "super" alone
> while the language specification allows the expression "super"
> only in the combination "super.Identifier".

Oh, thanks. That's precisely the kind of answer that I was looking for.

> The language specification says:
> 
>   Suppose that a field access expression super.name appears within class C,
>   and the immediate superclass of C is class S. Then super.name is treated
>   exactly as if it had been the expression ((S)this).name; thus, it refers
>   to the field named name of the current object, but with the current object
>   viewed as an instance of the superclass.
> 
> So the expression "super" alone may mean ((S)this) although not allowed
> by the language specification.
> 
> I think this is KJC's bug.  But can't we lazily accept this as a language
> extension by KJC?

I have no problems with that, if it doesn't matter for other people.

But then, I think that a warning regarding this should be generated, so
that people can know if their code is using something illegal in "pure"
Java.

BTW, just for curiosity's sake, has this use of "super" alone been
deprecated from the language? I'm asking this because it was used in the
(very old) James Gosling's book on Java that I have here.


Thank you very much for your answer, Rogério.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  Rogério Brito - rbrito at ime.usp.br - http://www.ime.usp.br/~rbrito
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=




More information about the kaffe mailing list