This is the mail archive of the
java-discuss@sourceware.cygnus.com
mailing list for the Java project.
Re: Error building libgcj on HP 10.20
- To: jsturm at sigma6 dot com
- Subject: Re: Error building libgcj on HP 10.20
- From: "'David Scott Urban" <urban at ast dot lmco dot com>
- Date: Fri, 07 Jan 2000 14:35:38 -0700 (MST)
- Cc: java-discuss at sourceware dot cygnus dot com
The patch did not work. I am still getting the same error.
I am currently using gcc 2.95.2 with the java patches applied. I am going to try
and compile the latest snapshot. Then, recompile libgcj with the patch applied
to see if that makes a difference.
I will start with a fresh setup of libgcj.
Scott Urban
>
> > 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