classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Classpath build process and VM-specific issues


From: Etienne Gagnon
Subject: Re: Classpath build process and VM-specific issues
Date: Mon, 05 Apr 2004 15:17:19 -0400
User-agent: Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:1.6) Gecko/20040402 Debian/1.6-4

For one thing, you have not shown me *your* native part.

Second, see below.

Andrew Haley wrote:
 > JNIEXPORT void JNICALL
 > Java_somepackage_someNativeMethod
 >    (JNIEnv *env, jobject this, jbyteArray nativePointer, ...)
> > {
 >    void *ptr;
 >    (*env)->GetByteArrayRegion(env, nativePointer, 0, sizeof(void *), (jbyte *) 
&ptr);

Danger, Will Robinson!  This is not legal C!!!!  You can *not* take
the address of a pointer and cast it to a jbyte*.

What's wrong with it?  What do you think you are doing, every time you use
malloc(), e.g.:

 buffer = (some cast) malloc(...);


All I am doing is the same, and is perfectly legal ANSI/ISO C.  Prove me wrong
with a specific ISO C specification clause, if you claim otherwise.

Etienne

--
Etienne M. Gagnon, Ph.D.             http://www.info.uqam.ca/~egagnon/
SableVM:                                       http://www.sablevm.org/
SableCC:                                       http://www.sablecc.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]