C++ to Fortran condition handling

This section provides two scenarios of condition handling behavior in a C to Fortran ILC application. If an exception occurs in a C routine, the set of possible actions is as described in Exception occurs in C. If an exception occurs in a Fortran program, the set of possible actions is as described in Exception occurs in Fortran.

Some conditions can be handled only by the HLL of the routine in which the exception occurred. For example, when an ERR or IOSTAT specifier is present on a Fortran I/O statement and an error is detected while executing that statement, the Fortran semantics take precedence over Language Environment condition handling. In this case, control returns immediately to the Fortran program and no condition is signaled to Language Environment.

C++ exception handling constructs try()/throw()/catch() cannot be used with Language Environment and Fortran condition handling. If you use C exception handling constructs (signal()/raise()) in your C++ routine, condition handling will proceed as described in this section. Otherwise, you will get undefined behavior in your programs if you mix the C++ constructs with the C constructs.

See z/OS Language Environment Programming Guide for a detailed description of Language Environment condition handling. For information about Fortran condition handling semantics, see VS FORTRAN Version 2 Language and Library Reference.