For C and C++

If a normal return from main() terminates the application, the user return code value is 0. When a C or C++ routine terminates an enclave with a language construct such as exit(n) or return(n), the value of n is used. In either case, any user return codes set through CEE3SRC are ignored; likewise, in an ILC application, any user return codes set with PL/I language constructs are also ignored.

If the enclave terminates due to an unhandled condition of severity 2 or greater, the user return code value used is the last one set by either CEE3SRC or, in an ILC application, PL/I language constructs. If neither CEE3SRC nor PL/I language constructs set the user return code, the user return code value is 0. See Termination behavior for unhandled conditions for information about unhandled conditions. See z/OS XL C/C++ Programming Guide for more information about C or C++ language constructs.