[patch,fortran] PRs 19363 and 19691, Cygwin failure in formatted write of Inf and NaN

Steve Kargl sgk@troutmask.apl.washington.edu
Mon Jan 31 23:17:00 GMT 2005


On Mon, Jan 31, 2005 at 03:05:50PM -0800, Steve Kargl wrote:
> On Mon, Jan 31, 2005 at 11:51:38PM +0100, Steven Bosscher wrote:
> > On Monday 31 January 2005 23:45, Steve Kargl wrote:
> > > How do you fix configure?  AFAIK, configure only
> > > compiles a test code to ensure that math.h defines
> > > isfinite().  It does not actually test to see if
> > > isfinite() actually works.  isfinite() is defined
> > > on Cygwin, but it does not work.
> > 
> > Then you add a check to see if it works.  libstdc++ has
> > a check for it iirc.
> > 
> 
> troutmask:sgk[211] pwd 
> /usr/tmp/sgk/gcc/libstdc++-v3
> troutmask:sgk[212] grep isfinite configure
> isfinite(0.0);
> 
> This does not test whether isfinite works when the
> number is NaN or Inf.  I'll also suggest that 0.0
> may be a bad choice for the the value to test.
> 
> See http://gcc.gnu.org/ml/fortran/2005-01/msg00092.html
> 

Sigh,  Like I said gcc only tries to compile a test code.
>From stdlib++/acinclude.m4

  # Check for the existence of <math.h> functions used if C99 is enabled.
  ac_c99_math=yes;
  AC_MSG_CHECKING([for ISO C99 support in <math.h>])
  AC_TRY_COMPILE([#include <math.h>],[fpclassify(0.0);],, [ac_c99_math=no])
  AC_TRY_COMPILE([#include <math.h>],[isfinite(0.0);],, [ac_c99_math=no])
  AC_TRY_COMPILE([#include <math.h>],[isinf(0.0);],, [ac_c99_math=no])


-- 
Steve



More information about the Fortran mailing list