This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: large_real_kind_1.f90 & huge()


Well, first, you should file a bug-report to HP-UX. isfinite() is
supposed (by C99) to be a macro that can work on long doubles.
Unfortunately, HP-UX is not the only system to ignore this
requirement: I wrote this TODO because I experienced the same
behaviour with Solaris 9 long doubles.

So, I guess we should have a test in acinclude.m4 that tests if
isfinite works (let's say, a test that calls isfinite() on a
LDBL_MAX). Then, in libgfortran.h:

#if (!defined(isfinite) || defined(__CYGWIN__))
#undef isfinite
#if defined(fpclassify)
#define isfinite(x) (fpclassify(x) != FP_NAN && fpclassify(x) != FP_INFINITE)
#else
#define isfinite(x) ((x) - (x) == 0)
#endif
#endif /* !defined(isfinite)  */

use the poor man's isfinite() depending on the result of this test
(say HAVE_BROKEN_ISFINITE).

I don't have time now to work on this patch, but I will gladly review it.

FX


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