Function
#pragma NO_RETURN
None
None
None
This pragma suppresses the generation of the return instruction (return from a subroutine or return from an interrupt). This may be useful if you care about the return instruction itself or if the code has to fall through to the first instruction of the next function.
This pragma does not suppress the generation of the exit code at all (e.g., deallocation of local variables or compiler generated local variables). The pragma suppresses the generation of the return instruction.
The example in the following listing places some functions into a special named segment. All functions in this special code segment have to be called from an operating system every 2 seconds after each other. With the pragma some functions do not return. They fall directly to the next function to be called, saving code size and execution time.
#pragma CODE_SEG CallEvery2Secs #pragma NO_RETURN void Func0(void) { /* first function, called from OS */ ... } /* fall through!!!! */ #pragma NO_RETURN void Func1(void) { ... } /* fall through */ ... /* last function has to return, no pragma is used! */ void FuncLast(void) { ... }