Fwd: Kaffe runs(!) under VC++

Daniel.Veillard at w3.org Daniel.Veillard at w3.org
Sun Nov 2 10:47:53 PST 1997

[Repost after bounce, sender : Greg Stark <gsstark at mit.edu>]

Michael Gesundheit <mikeg at rocketmail.com> writes:
> java_lang_System_setOut0(_P_[0].p){}
> This is an attempt to pass a jref (void *) as a
> parameter. The value which was passed is 0 even though
> the pointer is there !!. 
> I don't have a clear explanation but I know the 
> following:
> I added a local
> void *vp = _P_[0].p;
> and passed vp as a parameter. This works fine. Now the
> parameter is passed as expected.
> I did the same to all the functions in this file and
> kaffe runs!!

That sounds very broken, if you can narrow this down to a simple ANSI C file
that demonstrates this behaviour i suggest reporting it as a bug to Microsoft.
Of course you wouldn't get a bug fix unless you paid them for support. (Some
might suggest just switching to djgpp or gcc and returning VC++ for the money
you paid for it instead.)

I suspect this has to do with the broken i386/DOS memory models which use
various sized pointers memory segments. I know relatively little about this,
but i imagine putting it in a void* forces it to use a 32 bit pointer instead
of a 16 bit pointer or something like that.

> I did expirimented a little with union on Solaris and
> PC and found the following:
> In PC when I write to any of the union elements the
> value appears in all of them in the least significant
> 4 bytes. (I wrote a pointer).
> On a sparc system if I wrote to a long long the value
> appear in the UPPER 4 bytes!!. 

This is called byte-order. it's exactly what you should expect. Kaffe has
presumably dealt with any byte-order dependencies since it already works under
chips of both varieties.


More information about the kaffe mailing list