[Cfp-interest] Fwd: (SC22WG14.13396) What syntax should be used to express IEEE 754-2008 alternate exception handling in C?

Jim Thomas jaswthomas at sbcglobal.net
Tue Aug 5 14:10:35 PDT 2014


From Hans Boehm ...

Begin forwarded message:

> From: Hans Boehm <boehm at acm.org>
> Subject: Re: (SC22WG14.13396) What syntax should be used to express IEEE 754-2008 alternate exception handling in C?
> Date: August 5, 2014 at 10:08:42 AM PDT
> To: Jim Thomas <jaswthomas at sbcglobal.net>
> 
> Hi Jim,
> 
> I haven't been following this discussion closely enough, but wanted to express some vague uneasiness about adding another exception handling mechanism to C.  We already have Posix thread cancellation, and some code has to deal with C++ exceptions.  Correct programs in theory have to deal with all of these by providing clean-up actions that are compatible with any kind of exception that might pass through a particular function frame.  Having to deal with more than one kind of exception seems somewhere between ugly and intractable.
> 
> In my opinion, Posix thread cancellation is broken enough that I would love to see it replaced by something that looks more like C++ exceptions.  But that opinion is not universally shared, and the Posix folks seem quit attached to it.
> 
> Thanks.
> 
> Hans
> (Also now officially retired from HP, but really at Google)
> 
> 
> On Wed, Jul 23, 2014 at 9:23 AM, Jim Thomas <jaswthomas at sbcglobal.net> wrote:
> 
> On Jul 23, 2014, at 9:08 AM, Jens Gustedt <jens.gustedt at inria.fr> wrote:
> 
> > Hello
> > (sorry for the previous unfinished mail)
> >
> > Am Mittwoch, den 23.07.2014, 08:50 -0700 schrieb Jim Thomas:
> >> 1. fetestexcept does not distinguish sub exemptions (FE_INVALID_ADD,
> >> FE_INVALID_SNAN, etc.), as IEEE 754 specifies to be done.
> >
> > If the two specifications don't agree, we have a serious
> > problem. Maybe they could be made consistent by having FE_INVALID as
> > bit-or of the subcases?
> >
> >> 2. fetestexcept does not detect all occurrences of IEEE 754 underflow,
> >> because exact underflows do set the underflow flag, though they are
> >> underflows.
> >
> > I am not sure that I follow, can you please elaborate?
> 
> Per IEEE 754, an underflow exception occurs (with the intention that a trap occurs if traps are supported) when a tiny nonzero result is detected . If (and only if) also the rounded result is inexact, then the underflow flag is raised.
> -Jim
> 
> >
> > Jens
> >
> > --
> > :: INRIA Nancy Grand Est ::: AlGorille ::: ICube/ICPS :::
> > :: ::::::::::::::: office Strasbourg : +33 368854536   ::
> > :: :::::::::::::::::::::: gsm France : +33 651400183   ::
> > :: ::::::::::::::: gsm international : +49 15737185122 ::
> > :: http://icube-icps.unistra.fr/index.php/Jens_Gustedt ::
> >
> >
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.oakapple.net/pipermail/cfp-interest/attachments/20140805/1875852d/attachment.html 


More information about the Cfp-interest mailing list