11.07.2015 Views

CrossWorks for ARM User Guide

CrossWorks for ARM User Guide

CrossWorks for ARM User Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

longjmpSynopsisDescriptionImportant notesPortability#include void longjmp(jmp_buf env, int val);longjmp restores the environment saved by the most recent invocation of setjmp withthe corresponding jmp_buf argument. If there has been no such invocation, or if thefunction containing the invocation of setjmp has terminated execution in the interim,the behavior iof longjmp undefined.When the environment is restored, all accessible objects have values have state as of thetime the longjmp function was called.After longjmp is completed, program execution continues as if the correspondinginvocation of setjmp had just returned the value specified by val. Note that longjmpcannot cause setjmp to return the value 0; if val is 0, setjmp returns the value 1.Objects of automatic storage duration that are local to the function containing theinvocation of the corresponding setjmp that do not have volatile-qualified type andhave been changed between the setjmp invocation and longjmp call areindeterminate.longjmp con<strong>for</strong>ms to ISO/IEC 9899:1990 (C90) and ISO/IEC 9899:1999 (C99).See also setjmp (page 277)setjmpSynopsisDescriptionPortability#include int setjmp(jmp_buf env);setjmp saves its calling environment in the jmp_buf argument env <strong>for</strong> later use by thelongjmp function.On return is from a direct invocation, setjmp returns the value zero. If the return isfrom a call to the longjmp function, the setjmp macro returns a nonzero valuedetermined by the call to longjmp.The ISO standard does not specify whether setjmp is a macro or an identifier declaredwith external linkage. If a macro definition is suppressed in order to access an actualfunction, or a program defines an external identifier with the name setjmp, thebehavior of setjmp is undefined.setjmp con<strong>for</strong>ms to ISO/IEC 9899:1990 (C90) and ISO/IEC 9899:1999 (C99).See also longjmp (page 277)Chapter 28 - Non-local jumps277

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!