Error building libgcj on HP 10.20
Jeff Sturm
jsturm@sigma6.com
Sat Apr 1 00:00:00 GMT 2000
> In file included from ../../../libgcj/libjava/java/lang/mprec.h:36,
> from ../../../libgcj/libjava/java/lang/fdlibm.h:25,
> from ../../../libgcj/libjava/interpret.cc:20:
> /home/urban/local/hp10/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.95.2/include/math.h:
> In function `double pow(double, int)':
> /home/urban/local/hp10/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.95.2/include/math.h:74
> : declaration of C function `double pow(double, int)' conflicts with
^^^^^^^^^^
There's a clue... pow(double, int) is supposed to be declared as an
inline C++ function, not a C function.
The header libjava/java/lang/mprec.h includes <math.h> from within a
`extern "C" {...}' block... that looks wrong to me. (Are nested "C"
blocks even allowed in C++?)
Try the patch below and let us know if it works. (BTW the warnings
about __malloc__ indicate your gcj compiler is out-of-date.)
Index: mprec.h
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/lang/mprec.h,v
retrieving revision 1.3
diff -u -r1.3 mprec.h
--- mprec.h 1999年07月12日 09:40:07 1.3
+++ mprec.h 2000年01月07日 18:56:47
@@ -33,6 +33,10 @@
#include <config.h>
#include "ieeefp.h"
+#ifdef __cplusplus
+}
+#endif
+
#include <math.h>
// #include <float.h>
// #include <errno.h>
@@ -51,6 +55,9 @@
#include <sys/config.h>
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
/* ISO C9X int type declarations */
--
Jeff Sturm
jsturm@sigma6.com
More information about the Java
mailing list