[comp.lang.fortran] exit status to

bross@nas.nasa.gov (Wilson S. Ross) (05/25/91)

FYI and in case anyone has a better workaround:

While porting some code to the rs6000 I discovered that "call exit(n)"
which I had been taking for granted on many other machines is not an
official Fortran statement: "call exit(0)" triggers the echo stmt in
"a.out || echo non0."  So far I have found 2 ways to get around this
on the rs6000: "stop 0" or "stop 'xx'" and "i=0 / call exit(%val(i))"
will return 0, and "stop 1" or "i=1 etc" will return 1. Unfortunately
these methods fail on other machines, which all seem to handle exit()
fine and ignore stop values (sparc, iris, mips, fps500, ymp, stardent
stellar, stardent ardent, vax750_or_so), except the Amdahl 5880 which
doesn't return exit status by any of the above methods. I guess I'll
need to add a machine-dependant mexit() routine (the Amdahl isn't a
target machine yet). The ANSI standard leaves the environmental effect
of "STOP n" undefined for flexibility, by the way.

Bill Ross     mail on this to ross@cgl.ucsf.edu