In my Quickwin program I am calling the function RUNQQ to launch an external program. Successful execution of the program is supposed to be indicated by the return value. I have noticed a peculiar problem. The relevant program snippet is very simple:
IRETURN = RUNQQ ('AnyExec.exe', '-ComlineParam')
IF (IRETURN == -1) PRINT *, 'Application failed'
IF (IRETURN /= -1) PRINT *, 'Application succeeded')
Say that AnyExec.exe does not exist in any searchable path--or say it is not on the computer at all. The function will then return -1, as it should, which can be tested for "application failed". Fine and dandy.
But suppose that someone stupidly (!) forgets to include USE IFPORT. I would expect to get a linker error (unresolved reference), or at least a run time error. But my program runs merrily, returning a seemingly random number from RUNQQ. Testing this value (which is NOT -1), my program happily reports that the application ran successfully.
Needless to say this failed reporting can cause embarassing problems. Why doesn't the compiler or linker report a problem? (and yes I know that EXPLICIT NONE would have helped, but that's another story...)