[gfortran,patch] -ffpe-trap library support for SysV

Steve Kargl sgk@troutmask.apl.washington.edu
Thu Oct 13 17:47:00 GMT 2005


On Thu, Oct 13, 2005 at 04:48:32PM +0200, Fran?ois-Xavier Coudert wrote:
> > Not OK for FreeBSD.  I need to look into the details,
> > but fpsetmask has been deprecated in FreeBSD and new
> > code is suppose to use the fenv(3) facilities.  Off
> > hand, I do not remember the version of FreeBSD when
> > the change was made.

fpsetmask (and friends) were deprecated in the 5.3 release.  These
functions are only present on i386 and amd64 systems.  They are
still in the FreeBSD 7.X source tree.  Note, FreeBSD runs
on sparc, alpha, and ppc.  fenv is present on architectures, but
I don't know how functional it is.

> Well, this is not hardcoded as the solution for FreeBSD. The configury
> just checks for fpsetmask, and if it's there, uses it. So I guess that
> should not be a problem.

OK.  I looked at your patch.  I'll test and review it more formally
on Saturday.

> As for fenv (it's already been discussed here), there's no C99 way to
> raise FPE on individually selected exceptions.

Huh?  feraiseexcept(FE_OVEFLOW) will raise an overflow exception.
You can do the same with FE_INVALID, FE_DIVBYZERO, FE_INEXACT, 
and FE_UNDERFLOW.

-- 
Steve



More information about the Fortran mailing list