John.Keenan:Am I correct in assumming that the floating point processor control word is changed when entering the fortran code and then returned to its previous state when exiting the Fortran code? In other words the state of the calling environment should have no affect on the Fortran floating point processor specification.
No. Even for code compiled with /fpe:0 (produce exceptions), exceptions can still be masked by the FPCW, which is outside of control of your dll. In my Dll I have:
integer, parameter:: FP_MASK= FPCW$INVALID.or.FPCW$ZERODIVIDE
integer(2):: iFp, iFpu
call getcontrolfpqq(iFpu)
#ifdef RELEASE
iFp=ior(iFpu,FP_MASK)
#else
iFp=iand(iFpu, not(FP_MASK))
#endif
call setcontrolfpqq(iFp)
at entry of every entry-point routine (well, actually, in one wrapper function, but the code is always executed). Probably the FPCW should be set back to the original value on return (so that the dll "plays nice").
Jugoslav (
www.xeffort.com)