The information in this article applies to:
SYMPTOMSA program that contains a longjmp called inside a _try block may not call a _finally block. The sample code below is verified to work consistently on Alpha, MIPS and Intel platforms. It fails only on Power PC. WORKAROUNDThe solution is to include the setjmpex.h file instead of setjmp.h. The latter provides consistent behavior on all platforms, but may cause a performance degradation. Note: either setjmp.h or setjmpex.h may be included, but not both, because each defines the setjmp macro in a different way. STATUSThis behavior is by design. MORE INFORMATIONThe on-line documentation claims the following: "Exiting a try-finally statement using a return statement or the longjmp run-time function is considered abnormal termination. It is illegal to jump into a __try statement, but legal to jump out of one."Consequently, a longjmp within a _try block should cause the _finally to be executed. Sample Code
Additional query words:
Keywords : kbVC kbPowerPC |
Last Reviewed: January 31, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |