I can use one of my program in 2 different modes: Executable or dll.
Last week I found that execution is different depending on the mode. While the executable could finish without problems, the dll version triggered a run tim error. Reason for the run time error was an underflow condition for a floating point operation.
Example: Double Precision :: x, y x = 1.0d-180 y = x * x ! creates underflow
In both modes the same object file, created with FTN95 without option /UNDERFLOW, is used and linked either to the executable or to the dll.
It took two days of testing until finding the reason, as the error diagnostic for the dll was not specific and did not tell the reason and/or location.
Meanwhile I inserted a call to the routine MASK_UNDERFLOW@ as a 1st executable statement into the code for the dll-version. Now the run time error disappears.
Questions:
- Is there a certain reason for different exception handling?
- Is the call to MASK_UNDERFLOW@ the preferable method to avoid run time errors when calling routines from a dll?
- Can multiple calls to MASK_UNDERFLOW@ cause problems, in the case that the dll-function is used several time?