#pragma NO_EXIT: No Exit Code

Scope

Function

Syntax

#pragma NO_EXIT

Synonym

None

Arguments

None

Default

None

Description

This pragma suppresses generation of the exit code and is useful for inline assembler functions. The two pragmas NO_ENTRY and NO_EXIT together avoid generation of any exit/entry code. Functions written in High-Level Inline (HLI) assembler can therefore be used as custom entry and exit code.

The compiler can often deduce if a function does not return, but sometimes this is not possible. This pragma can then be used to avoid the generation of exit code.

Tip: Use a #pragma NO_ENTRY and a #pragma NO_EXIT with HLI-only functions to avoid generation of any additional frame instructions by the compiler.

The code generated in a function with #pragma NO_EXIT may not be safe. It is assumed that the user ensures correct memory usage.

Note: Not all backends support this pragma. Some may still generate exit code even if this pragma is specified.
Example

The following listing shows how to use the NO_EXIT pragma (along with others) to avoid any generated code by the compiler. All code is written in inline assembler.

Listing: Blocking Compiler-generated function management instructions


#pragma NO_ENTRY 
#pragma NO_EXIT 
#pragma NO_FRAME 
#pragma NO_RETURN 
void Func0(void) { 
 __asm {/* No code should be written by the compiler.*/ 
 ... 
 } 
} 
See also

#pragma NO_ENTRY: No Entry Code

#pragma NO_FRAME: No Frame Code

#pragma NO_RETURN: No Return Instruction