Fortran 77’s alternate returns mechanism is obsolete and should not be used if portability is an issue. There is no equivalent in C to alternate returns, so the only concern would be for a C routine calling a Fortran routine with alternate returns. Fortran 95 will accept Fortran 77 alternate returns, but its use should be discouraged.
The implementation returns the int value of the expression on the RETURN statement. This is implementation dependent and its use should be avoided.
Table 11–17 Alternate Returns
C calls Fortran |
Running the Example |
||
---|---|---|---|
|
The C routine receives the return value 2 from the Fortran routine because it executed the RETURN 2 statement. |