Hi, Happy new year everyone!

For the last several weeks, I noticed kaffe weekly build can not be made
on m68k/linux. Today, I can spend some time to check why it happens.

Mainly this is because compilation flag '-Werror' has been added to
compile 'java_nio_MappedByteBufferImpl.c'. After adding this, gcc detects
two functions can not be properly compiled because arguments to these
functions are not used.

The two functions are Java_java_nio_MappedByteBufferImpl_isLoadedImpl and
Java_java_nio_MappedByteBufferImpl_loadImpl. And the real reason is if we
don't have 'mincore' or 'madvise' functions, these two functions are
compiled without doing actual work, and hence the arguments to these
functions are not used.

My proposed patch are attached, but aren't there anyone who have better
idea for this? This problem has been filed as Bug#83 in the DB.

Thanks in advance.

Kiyo

--- java_nio_MappedByteBufferImpl.c     2007-01-05 21:05:30.000000000 +0900
+++ /tmp/java_nio_MappedByteBufferImpl.c        2007-01-05 20:42:41.000000000 
+0900
@@ -196,8 +196,6 @@
     }
   return JNI_TRUE;
 #else
-  /* The next line has never been executed */
-  if (0&&(env==NULL)&&(this==NULL)) return JNI_FALSE;
   return JNI_FALSE;
 #endif
 }
@@ -215,8 +213,6 @@
 
   madvise (address, size, MADV_WILLNEED);
 #else
-  /* The next line has never been executed */
-  if (0&&(this==NULL)) return;
   JCL_ThrowException (env, IO_EXCEPTION,
                       "forcing mapped files into core not implemented");
 #endif /* HAVE_MADVISE */
 

_______________________________________________
kaffe mailing list
kaffe@kaffe.org
http://kaffe.org/cgi-bin/mailman/listinfo/kaffe

Reply via email to