[guppi-list] RE: Guppi-0.40.3: conflicting types for `_SINFINITY'



Title: RE: Guppi-0.40.3: conflicting types for `_SINFINITY'

Hi,

I have a problem with Guppi-0.40.3 on hp-ux 11.00
could you please take the following patches from Jon K Hellan to fix this.

for furhter questions

Regards Martin

> -----Original Message-----
> From: Jon K Hellan [mailto:hellan acm org]
> Sent: Monday, April 08, 2002 8:56 PM
> To: Gansser, Martin
> Subject: Re: Guppi-0.40.3: conflicting types for `_SINFINITY'
>
>
> On Mon, Apr 08, 2002 at 11:50:37AM +0200, Gansser, Martin wrote:
> > another question with hp-ux 11.00.
> >
> >
> > the following error appears, if I compile Guppi on hp-ux 11.00:
>
> You should write to the guppi maintainer, Jon Trowbridge, about this,
> so that the changes get merged into the distribution. But here are
> some suggestions which you can forward:

> > gnan.c: In function `g_finite':
> > gnan.c:128: warning: implicit declaration of function `finite'
>
> Here's g_finite:
>
> gboolean
> g_finite (double x)
> {
>   /* FIXME: This needs to be made portable. */
>   return finite (x);
> }
>
> They could probably use the following snippet from gnumeric's
> src/mathfunc.h:
>
> #ifndef FINITE
> #  if defined(HAVE_FINITE)
> #    ifdef HAVE_IEEEFP_H
> #      include <ieeefp.h>
> #    endif
> #    define FINITE finite
> #  elif defined(HAVE_ISFINITE)
> #    define FINITE isfinite
> #  else
> #    error FINITE undefined
> #  endif
> #endif
>
> For this to work, the following has to be added to configure.in:
>
> dnl
> dnl On Solaris finite() needs ieeefp.h
> dnl
> AC_CHECK_HEADERS(ieeefp.h)
>
> dnl Check for some functions
> AC_CHECK_FUNCS(finite)
>
> dnl
> dnl On BSD, we seem to need -lm for finite
> dnl
> if test $ac_cv_func_finite = no; then
>   AC_CHECK_LIB(m, finite,
>         [AC_DEFINE(HAVE_FINITE)
>          LIBS="$LIBS -lm"])
> fi
>
> dnl isfinite is a macro on HPUX
> AC_TRY_COMPILE([#include <math.h>], [int a = isfinite(0.0)],
> [AC_DEFINE(HAVE_ISFINITE)], [])
>
> And to acconfig.h:
>
> #undef HAVE_FINITE
> #undef HAVE_ISFINITE
> #undef HAVE_IEEEFP_H
>
> g_finite might then be changed to:
>
> gboolean
> g_finite (double x)
> {
>   return FINITE (x);
> }
>
> > guppi-config-model.c:40: warning: excess elements in array
> initializer
> > guppi-config-model.c:40: warning: (near initialization for
> > `guppi_config_model_signals')
> > guppi-defaults.c: In function `cant_find_default_font':
> > guppi-defaults.c:40: warning: implicit declaration of
> function `exit'
>
> Harmless.
>
> > guppi-string.c: In function `guppi_string_noise_count':
> > guppi-string.c:170: warning: subscript has type `char'
>
> This could be unportable code. But probably no big deal.
>
> > const.c:99: conflicting types for `_SINFINITY'
> > /opt/gcc/lib/gcc-lib/hppa2.0n-hp-hpux11.00/3.0.4/include/math.h:344:
> > previous declaration of `_SINFINITY'
>
> Try this patch to const.c:
>
> --- const.c.~1.3.~    Sat May  5 20:16:23 2001
> +++ const.c   Mon Apr  8 20:52:32 2002
> @@ -93,10 +93,12 @@
>  double LOGSQ2 = 3.46573590279972654709E-1;   /* log(2)/2 */
>  double THPIO4 = 2.35619449019234492885;      /* 3*pi/4 */
>  double TWOOPI = 6.36619772367581343075535E-1;        /* 2/pi */
> -#ifdef INFINITIES
> +#ifndef INFINITY
> +#  ifdef INFINITIES
>  double INFINITY = 1.0 / 0.0; /* 99e999; */
> -#else
> +#  else
>  double INFINITY = 1.79769313486231570815E308;        /*
> 2**1024*(1-MACHEP) */
> +#  endif
>  #endif

>  #ifdef MINUSZERO
>
> Good luck
>
> Jon Kåre
>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]