This is the mail archive of the java-patches@gcc.gnu.org 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]
Other format: [Raw text]

Re: Patch: FYI: fix classpath/23863


>>>>> "Marco" == Marco Trudel <mtrudel@gmx.ch> writes:

Marco> The new function _calloc_r from your patch
Marco> (http://gcc.gnu.org/ml/java-patches/2006-q2/msg00347.html) breaks
Marco> compilation on cygwin.

Thanks for trying this!

Marco> /cygdrive/d/marco/GCC/source/libjava/classpath/native/fdlibm/mprec.c:104:
Marco> error: static declaration of 'calloc' follows non-static declaration

I'd guess that cygwin declares _calloc_r in a header somewhere.
I don't think we need to call this function '_calloc_r' in
mprec... try the appended patch.  If it works for you I will check it in.

Marco> /cygdrive/d/marco/GCC/source/libjava/classpath/native/fdlibm/mprec.c:105:
Marco> error: expected identifier or '(' before '{' token

Marco> I can fix the static error by remove the static specifier, but I have
Marco> no idea what the second error could mean... Any ideas?

A mysterious error like this usually means that there is some #define
that makes the output look weird... I usually look at the 'gcc -E'
output to see what the code looks like after preprocessing.

I suspect the patch may fix this error as well.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	* native/fdlibm/mprec.c (mprec_calloc): Renamed.
	(Balloc): Updated.

Index: native/fdlibm/mprec.c
===================================================================
--- native/fdlibm/mprec.c	(revision 117197)
+++ native/fdlibm/mprec.c	(working copy)
@@ -101,7 +101,7 @@
 typedef long __Long;
 
 static void *
-_calloc_r (void *ignore, size_t x1, size_t x2)
+mprec_calloc (void *ignore, size_t x1, size_t x2)
 {
   char *result = (char *) malloc (x1 * x2);
   memset (result, 0, x1 * x2);
@@ -119,7 +119,7 @@
   if (_REENT_MP_FREELIST(ptr) == NULL)
     {
       /* Allocate a list of pointers to the mprec objects */
-      _REENT_MP_FREELIST(ptr) = (struct _Bigint **) _calloc_r (ptr, 
+      _REENT_MP_FREELIST(ptr) = (struct _Bigint **) mprec_calloc (ptr, 
 						      sizeof (struct _Bigint *),
 							       new_k);
       if (_REENT_MP_FREELIST(ptr) == NULL)
@@ -150,7 +150,7 @@
     {
       x = 1 << k;
       /* Allocate an mprec Bigint and stick in in the freelist */
-      rv = (_Bigint *) _calloc_r (ptr,
+      rv = (_Bigint *) mprec_calloc (ptr,
 				  1,
 				  sizeof (_Bigint) +
 				  (x-1) * sizeof(rv->_x));


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