This is the mail archive of the java-patches@sourceware.cygnus.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]

Patch: Implicit declaration errors


Building the latest libgcj with the latest gcc gives several "implicit
declaration" errors like the following:

c++ -DHAVE_CONFIG_H -I. -I../../../libjava -I./include
-I../../../libjava -Iinclude -I../../../libjava/include
-I../../../libjava/../boehm-gc -I./../boehm-gc -DLINUX_THREADS=1
-D_REENTRANT=1 -DSILENT=1 -DNO_SIGNALS=1 -DNO_DEBUGGING=1
-DJAVA_FINALIZATION=1 -I../../../libjava/libltdl -I./libltdl
-I../../../libjava/../compat-include -I../../../libjava/../zlib
-I../../../libjava/../libffi/include -I../libffi/include -fno-rtti
-fvtable-thunks -fasynchronous-exceptions -D__NO_MATH_INLINES
-ffloat-store -W -Wall -D_GNU_SOURCE -g -O2 -fvtable-thunks
-D_GNU_SOURCE -Wp,-MD,.deps/exception.pp -c  -fPIC -DPIC
../../../libjava/exception.cc -o .libs/exception.lo
In file included from ../../../libjava/exception.cc:19:
../../../libjava/gcj/cni.h: In function `java::lang::String
*JvNewStringLatin1 (const char *)':
../../../libjava/gcj/cni.h:63: implicit declaration of function
`strlen'

The following patch fixes these.

ok to check in?

regards

  [ bryce ]


2000-05-31  Bryce McKinlay  <bryce@albatross.co.nz>

	* gcj/cni.h: Include <string.h>.
	* defineclass.cc: Include <alloca.h>.
	* interpret.cc: Ditto.
	* gij.cc: Include stdlib.h.

Index: gcj/cni.h
===================================================================
RCS file: /cvs/java/libgcj/libjava/gcj/cni.h,v
retrieving revision 1.5
diff -u -r1.5 cni.h
--- cni.h	2000/03/07 19:55:24	1.5
+++ cni.h	2000/05/31 11:02:40
@@ -18,6 +18,8 @@
 
 #include <gcj/array.h>
 
+#include <string.h>
+
 extern inline jobject
 JvAllocObject (jclass cls)
 {
Index: defineclass.cc
===================================================================
RCS file: /cvs/java/libgcj/libjava/defineclass.cc,v
retrieving revision 1.9
diff -u -r1.9 defineclass.cc
--- defineclass.cc	2000/03/07 19:55:24	1.9
+++ defineclass.cc	2000/05/31 11:02:56
@@ -24,6 +24,7 @@
 
 #ifdef INTERPRETER
 
+#include <alloca.h>
 #include <java-cpool.h>
 #include <gcj/cni.h>
 
Index: interpret.cc
===================================================================
RCS file: /cvs/java/libgcj/libjava/interpret.cc,v
retrieving revision 1.16
diff -u -r1.16 interpret.cc
--- interpret.cc	2000/05/19 17:55:27	1.16
+++ interpret.cc	2000/05/31 11:03:06
@@ -35,6 +35,8 @@
 
 #ifdef INTERPRETER
 
+#include <alloca.h>
+
 #define ClassError _CL_Q34java4lang5Error
 extern java::lang::Class ClassError;
 
Index: gij.cc
===================================================================
RCS file: /cvs/java/libgcj/libjava/gij.cc,v
retrieving revision 1.8
diff -u -r1.8 gij.cc
--- gij.cc	2000/03/07 19:55:24	1.8
+++ gij.cc	2000/05/31 11:03:06
@@ -16,6 +16,7 @@
 
 #include <stdio.h>
 #include <string.h>
+#include <stdlib.h>
 
 #include <java/lang/System.h>
 #include <java/util/Properties.h>

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