|[19 earlier articles]|
|Re: Generating Java Bytecode email@example.com (1996-11-26)|
|Re: Generating Java Bytecode firstname.lastname@example.org (1996-11-26)|
|Re: Generating Java Bytecode email@example.com (Nor Jaidi) (1996-11-26)|
|Re: Generating Java Bytecode Freek.Wiedijk@phil.ruu.nl (1996-12-01)|
|Re: Generating Java Bytecode firstname.lastname@example.org (1996-12-01)|
|Re: Generating Java Bytecode email@example.com (Jeremy Greene) (1996-12-01)|
|Re: Generating Java Bytecode Antoine.Leca@renault.fr (Antoine Leca) (1996-12-01)|
|Re: Generating Java Bytecode firstname.lastname@example.org (Russell Bornsch++) (1996-12-03)|
|Re: Generating Java Bytecode email@example.com (1996-12-07)|
|From:||Antoine Leca <Antoine.Leca@renault.fr>|
|Date:||1 Dec 1996 23:09:37 -0500|
|References:||96-11-108 96-11-125 96-11-132|
|Keywords:||C, Java, comment|
Joe Hummel wrote:
: Bill Purvis <firstname.lastname@example.org> wrote:
: >The Java VM does support the basic things you need for C's pointer
: >rules - it's the Java Compiler that excludes them.
: Actually, I think it's the JVM that excludes general pointers...
: But we have to be careful when we say "pointer". Ada has pointers,
: and working Ada-->bytecode compilers seem to exist. But I think the
: problem is in supporting general pointers, i.e. pointer arithmetic and
: pointers to any old location in RAM:
: void *p;
: p = (void *) 0x0080001F; /* some memory location */
: *((int *) p) = 10; /* let's store 10 there */
I'm no C legalist, but from what I understand about C "undefined
behavior", there is a perfect example of it (BTW, this concept
is very near to the concept of erroneous in Ada83).
And a given C compiler is able to do whatever it want with undefined
behavior, including rejecting the program at compile-time. Since you
will need to rewrite in part the compiler, it seems to me that this
would be a good idea in this case.
OTOH, if you really need such a program, then JavaVM and universality
and "protection" don't seem good features to me...
[I believe that there are quite legal C programs that use pointer conversions
that are impossible in Java. Consider any call to malloc() which returns a
char * pointer that is invariably whomped into some other kind of pointer.
Yes, we could special-case malloc(), but you can equally well write your own
storage allocator which would have the same pointer behavior. -John]
Return to the
Search the comp.compilers archives again.