[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
multiple exceptions in 7.1
Discussion of multiple exceptions: draft 1.5.0 is fuzzy about cases of multiple
exceptions arising in one operation, and overspecifies the behavior of
signalException which is itself problematic in every other aspect as well.
Leaving aside whether 5.6.2 should be included at all, here is a rewrite that's
intended to focus on what's important:
===
Existing text:
===
An invocation of the signalException operation of 5.6.2 might signal any
combination of exceptions.
For an invocation of any other operation required by this standard, at most two
exceptions might be signaled, in just these combinations: overflow followed by
inexact, and underflow followed by inexact.
The inexact exception is signaled if the overflow exception receives default
handling, and might be signaled if the underflow exception receives default
handling (see 7.5).
In general, when an operation signals more than one exception, none of which
have alternate exception handling enabled, each signaled exception will receive
its default handling.
When an operation signals more than one exception, some or all of which have
alternate exception handling enabled, alternate exception handling will be
invoked for the most important exception, and languages define whether other
signaled exceptions receive default handling, alternate handling, or are
ignored.
Exceptions are listed in this clause in order of decreasing importance
(invalid, divideByZero, overflow, underflow, inexact).
===
Revised text:
===
An invocation of the signalException operation (5.6.2) might signal any
combination of exceptions.
Language standards define behavior of signalException when it signals more than
one
exception. [This sentence could be in 5.6.2 replacing "The order in which the
exceptions are signaled is unspecified."]
For an invocation of any other operation required by this standard, at most one
exception might be signaled directly; additional exceptions might be signaled
by default or
alternate exception handling.
Default exception handling for overflow (7.4) signals the inexact exception.
Default exception handling for underflow (7.5) signals the inexact exception
if the default result is inexact.
An invocation of the restoreFlags operation (5.7.4) might raise any combination
of
status flags directly, and the signalException operation (5.6.2) might raise any
combination of status flags indirectly through exception handlers.
For an invocation of any other operation required by this standard,
when all exceptions are handled by default, at most two status flags can be
raised,
underflow with inexact (7.4) or overflow with inexact (7.5).