This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [gfortran,patch] -ffpe-trap library support for SysV


On Thu, Oct 13, 2005 at 07:47:43PM +0200, FX Coudert wrote:
> >OK.  I looked at your patch.  I'll test and review it more formally
> >on Saturday.
> 
> Thanks. It will still enable this functionnality solaris, (open|net)bsd, 
> hpux and irix; that's a lot!
> 
> >>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.
> 
> What I wanted to say is: there's no C99 way to ask for a FPE to be 
> raised on individually selected exceptions. That is, there is no C99 way 
> to do:
> 
>   float x;
>   raise_fpe_on_ieee_exception(EXCEPTION_INVALID);
>   x = -2;
>   x = sqrt(x); // This raises a FPE

FYI (you probably already know this), glibc does offer this
functionality: feenableexcept and fedisableexcept.  If there's really
no C99 way to accomplish the same thing, perhaps FreeBSD should adopt
that?

-- 
Daniel Jacobowitz
CodeSourcery, LLC


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