Do not invoke functions in one language that collapse program stack frames of another language.
This guideline includes these situations:
You can use C/C++ longjmp() or COBOL STOP RUN and C/C++ exit() or _exit() calls if doing so does not collapse active stack frames of a language other than the language that initiates that action. For the languages that do not initiate the collapsing and the termination, these adverse effects might otherwise occur:
In general, exceptions incurred during the execution of a stack frame are handled according to the rules of the language that incurs the exception. Because the COBOL implementation does not depend on the interception of exceptions through system services for the support of COBOL language semantics, you can specify the TRAP(OFF) runtime option to enable the exception-handling semantics of the non-COBOL language.
COBOL for Windows saves the exception environment at initialization of the COBOL runtime environment and restores it on termination of the COBOL environment. COBOL expects interfacing languages and tools to follow the same convention.
related references
TRAP