We have large generated programs that are compiled using CVF 6.6 and run on various Windows PCs. The compilation options we use (amongst others) are /FPE:0 /check_underflow and /optimize:0.
The programs occasionally generate floating point exceptions, which we trap in a C try-except block. The exception is then dealt with a Fortran error handling routine.
It is important that the exception is trapped immediately, because then we have the context for the error and can report it properly.
This works very well for most exceptions. Underflow, Overflow and Zero Divide are trapped, and Denormal is delibrately ignored. Unfortunately we cannot cause the Invalid exception, the number concerned just becomes NaN, which we don't want.
I have tried various ways of clearing the Invalid control bit (which means generate exceptions) in the floating point control word, but with no avail.
If anybody else has come across this problem and has a solution, please reply!