[kaffe] Build failure without 'mincore' nor 'madvise'

Kiyo Inaba inaba at src.ricoh.co.jp
Fri Jan 5 05:39:52 PST 2007


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 */
 




More information about the kaffe mailing list