(j3.2006) ieee_set_halting_mode

Malcolm Cohen malcolm
Tue Sep 21 20:22:24 EDT 2010


Bill Long wrote:
> But then I looked in 10-007 and it says that
> ieee_set_halting_mode is a PURE Subroutine.  Is this just a mistake in
> the standard?  Certainly this routine is not PURE in any operational sense.

It certainly is in every operational sense.

I "sense" that this question arises because different people have different 
ideas of what PURE means.  It means different things in different C.S.-like 
contexts, in particular Fortran PURE procedures are not "pure functions" in at 
least one of the traditional CS senses as they are permitted to read global 
state.

The Fortran PURE is quite simply, it follows the rules in the Fortran standard. 
That's it.  These rules are designed to prevent communication between 
simultaneously (or indeed sequentially) executing PURE procedures. 
IEEE_SET_HALTING_MODE cannot successfully communicate between such procedures - 
the only procedure that gets to see any change in the halting modes is a 
procedure that is called by the procedure that set it.

Depending on how the hardware supports IEEE, this might indeed require some 
action on the part of the compiler in order to provide the semantics specified 
by c14.  That is not philosophically or materially different from the actions 
needed by the compiler to support the way the IEEE flags behave, that is, the 
effects of arithmetic when there is some possibility that IEEE_GET_FLAG might be 
called.

It is not a surprise that the c14 semantics don't precisely match what the 
hardware provides.

Cheers,
-- 
................................Malcolm Cohen, Nihon NAG, Tokyo.
 




More information about the J3 mailing list