Next: , Previous: Alternate Entry Points, Up: Debugging and Interfacing

13.11 Alternate Returns (SUBROUTINE and RETURN)

Subroutines with alternate returns (e.g. `SUBROUTINE X(*)' and `CALL X(*50)') are implemented by g77 as functions returning the C int type. The actual alternate-return arguments are omitted from the calling sequence. Instead, the caller uses the return value to do a rough equivalent of the Fortran computed-GOTO statement, as in `GOTO (50), X()' in the example above (where `X' is quietly declared as an INTEGER(KIND=1) function), and the callee just returns whatever integer is specified in the RETURN statement for the subroutine For example, `RETURN 1' is implemented as `X = 1' followed by `RETURN' in C, and `RETURN' by itself is `X = 0' and `RETURN').