[ First ] [ Previous ] [ Next ] [ Last ] [ Manuals ]
Non-local jumps and exception handling

Because the jmp_buf variable can be global, the setjmp and longjmp calls do not have to be in the same function body.
A jmp_buf variable must be initialized with a call to setjmp() before being used with longjmp(). Calling longjmp() with an un-initialized jmp_buf variable may crash the program. Variables assigned to registers through compiler optimization may be corrupted during execution between setjmp() and longjmp() calls. This situation can be avoided by declaring affected variables as volatile.
[ First ] [ Previous ] [ Next ] [ Last ] [ Manuals ]
Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.
Last updated: August 16, 2000