This is the mail archive of the java-patches@sources.redhat.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [PATCH] Cleanup patches to build libgcj on x86/linux



Alexandre Petit-Bianco writes:
> 
> Tom Tromey writes:
> 
> > I had forgotten about this.  I'm not using the latest compiler.
> > Could you check in this fix?
> 
> I have to verify that the patch let me compile with the fixed C++
> compiler -- I want to make sure the boehm GC failures are gone.

Even with the augmented attached patch, libjava/boehm.cc still doesn't
compile:

  /home/apbianco/src/libgcj/libjava/boehm.cc: In function 
  `void *_Jv_MarkObj (void *, void *, void *, void *)':
  /home/apbianco/src/libgcj/boehm-gc/gc_mark.h:120: too many arguments
  to function `char *GC_find_start

The macro PUSH_CONTENTS uses GC_FIND_START which calls GC_find_start
with 2 or 3 args, depending on PRINT_BLACK_LIST. `GC_find_start' seems
to be defined in boehm-gc/gc_mark.h as:

  ptr_t GC_find_start();

And is implemented in boehm-gc/mark.c as:

  # ifdef PRINT_BLACK_LIST
    ptr_t GC_find_start(current, hhdr, source)
    word source;
  # else
    ptr_t GC_find_start(current, hhdr)
  # define source 0
  # endif
  register ptr_t current;
  register hdr * hhdr;

libgcj seems to be compiled with PRINT_BLACK_LIST unset, which leaves
us with two arguments for GC_find_start. But in libjava/boehm.cc, the
first declaration of GC_find_start is `ptr_t GC_find_start()' (from
boehm-gc/gc_mark.h) and the C++ compiler complains about that. Which
brings me to my original question, since the log don't seem to
indicate that libjava/boehm/ and libjava/boehm.cc have tremendously
changed recently:

  > The C++ compiler all in a sudden started to be really picky -- or did
  > we have a way to silence it before which broke all in a sudden?

Shall I go ahead and check this incomplete fix in?

./A

2000-07-29  Alexandre Petit-Bianco  <apbianco@cygnus.com>

        * java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Type of the
        cast of the second argument to `ffi_raw_call' changed to match
        prototype.

2000-07-26  Alexandre Petit-Bianco  <apbianco@cygnus.com>

        * jni.cc (_Jv_JNIMethod::call): Type of the cast of the second
        argument to `ffi_raw_call' changed to match prototype.
        * interpret.cc (_Jv_InterpMethod::continue1): Likewise and also
        fix call to `ffi_java_raw_call.'

Index: libjava/interpret.cc
===================================================================
RCS file: /cvs/java/libgcj/libjava/interpret.cc,v
retrieving revision 1.18
diff -u -p -r1.18 interpret.cc
--- interpret.cc	2000/07/28 13:11:45	1.18
+++ interpret.cc	2000/07/30 03:42:02
@@ -706,9 +706,9 @@ void _Jv_InterpMethod::continue1 (_Jv_In
 #if FFI_NATIVE_RAW_API
	/* We assume that this is only implemented if it's correct	*/
	/* to use it here.  On a 64 bit machine, it never is.		*/
-	ffi_raw_call (cif, fun, (void*)&rvalue, raw);
+	ffi_raw_call (cif, (void (*)()) fun, (void*)&rvalue, raw);
 #else
-	ffi_java_raw_call (cif, fun, (void*)&rvalue, raw);
+	ffi_java_raw_call (cif, (void (*)()) fun, (void*)&rvalue, raw);
 #endif
 
	int rtype = cif->rtype->type;
Index: libjava/jni.cc
===================================================================
RCS file: /cvs/java/libgcj/libjava/jni.cc,v
retrieving revision 1.31
diff -u -p -r1.31 jni.cc
--- jni.cc	2000/04/20 17:39:30	1.31
+++ jni.cc	2000/07/30 03:42:06
@@ -1784,7 +1784,7 @@ _Jv_JNIMethod::call (ffi_cif *, void *re
   memcpy (&real_args[offset], args, _this->args_raw_size);
 
   // The actual call to the JNI function.
-  ffi_raw_call (&_this->jni_cif, (void (*) (...)) _this->function,
+  ffi_raw_call (&_this->jni_cif, (void (*) ()) _this->function,
		ret, real_args);
 
   _Jv_JNI_PopSystemFrame (env);
Index: libjava/java/lang/reflect/natMethod.cc
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/lang/reflect/natMethod.cc,v
retrieving revision 1.12
diff -u -p -r1.12 natMethod.cc
--- natMethod.cc	2000/07/27 23:57:06	1.12
+++ natMethod.cc	2000/07/30 03:42:10
@@ -414,7 +414,7 @@ _Jv_CallAnyMethodA (jobject obj,
 
   try
     {
-      ffi_call (&cif, (void (*) (...)) meth->ncode, result, values);
+      ffi_call (&cif, (void (*) ()) meth->ncode, result, values);
     }
   catch (Throwable *ex2)
     {

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]