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: fprintf, stderr undeclared


I always build with JVMPI disabled, since it does bad things
to the allocation sequence.  (It adds a third (!) function call
to every allocation call.  Unless of course you actually turn
it on, in which case it's MUCH worse.)

In any case, that explains the difference.

I checked in:

2004-08-23  Hans Boehm  <Hans.Boehm@hp.com>
       * defineclass.cc: Include <stdio.h>.
       * java/lang/natClassLoader.cc: Include <stdio.h>.

Index: defineclass.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/defineclass.cc,v
retrieving revision 1.40
diff -u -r1.40 defineclass.cc
--- defineclass.cc      13 Aug 2004 18:26:00 -0000      1.40
+++ defineclass.cc      23 Aug 2004 19:19:12 -0000
@@ -23,6 +23,7 @@
 #include <java-interp.h>

 #include <stdlib.h>
+#include <stdio.h>
 #include <java-cpool.h>
 #include <gcj/cni.h>

Index: java/lang/natClassLoader.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/lang/natClassLoader.cc,v
retrieving revision 1.68
diff -u -r1.68 natClassLoader.cc
--- java/lang/natClassLoader.cc 12 Aug 2004 06:53:42 -0000      1.68
+++ java/lang/natClassLoader.cc 23 Aug 2004 19:19:13 -0000
@@ -13,6 +13,7 @@
 #include <config.h>

 #include <stdlib.h>
+#include <stdio.h>
 #include <string.h>

 #include <gcj/cni.h>

> -----Original Message-----
> From: Bryce McKinlay [mailto:mckinlay@redhat.com]
> Sent: Thursday, August 19, 2004 6:16 PM
> To: Boehm, Hans
> Cc: 'java@gcc.gnu.org'
> Subject: Re: fprintf, stderr undeclared
> 
> 
> Boehm, Hans wrote:
> 
> >I keep running into build errors with undefined references
> >to stderr and fprintf on the trunk,  in libjava/defineclass.cc,
> >line 340, and in two places in java/lang/natClassloader.cc.
> >
> >Am I missing something?  I don't see reference to anything
> >like <stdio.h>?  Why am I the only one complaining?
> >Do newer headers have transitive includes
> >which are hiding this problem?
> >  
> >
> jni.h includes stdio.h for compatability with Sun's header, 
> and jni.h is 
> picked up from defineclass.cc if JVMPI is enabled (which I 
> guess it is 
> by default):
> 
> In file included from ../../../libjava/include/jvmpi.h:18,
>                  from ../../../libjava/include/jvm.h:503,
>                  from ../../../libjava/include/java-interp.h:15,
>                  from ../../../libjava/defineclass.cc:24:
> 
> There should certainly be a direct #include in those files - 
> feel free 
> to check in a patch under the "obvious fix" rule.
> 
> Thanks
> 
> Bryce
> 


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