From: "FX" <[log in to unmask]>
Sent: Wednesday, November 27, 2013 3:55 AM
>(For the context: I am implementing the Fortran IEEE modules in GNU fortran, and would like to get
>things right... the more I read the standard, the more tricky cases I can think of!)
>Does the following program halt or not?
> program test
> use ieee_exceptions
> call ieee_set_halting_mode (ieee_invalid, .true.)
> call ieee_set_flag (ieee_invalid, .true.)
> end
> The standard says that flags are raised when an exception occurs, but it does not say that raising
> flags triggers an exception. And the very brief "halting" paragraph talks about exceptions, not
> flags.
> So, I think the above should *not* raise an exception. Am I getting it right?
I thnk that you have already answered the question youself.
The flags are set when an exception occurs. The excception occurs first.
Logically, setting the flag should not raise an exception.
|