### avoid_ebp

Disables the EBP as a temporary register to ensure that the base pointer is valid even when full optimizations are enabled.

##### Syntax

#pragma avoid_ebp on | off

##### Targets

Intel x86

##### Remarks

Disabling the use of the EBP register with #pragma avoid_ebp on ensures that the stack chains are coherent, even if they do not include every called function, so code that relies on the stack chain (i.e. crash recovery tools and structured exception handling) will work more consistently. Note that this can have an effect on performance (only 6 internal registers are available instead of 7) so do not use it in speed-critical code.

This #pragma is recommended for programs using _set_se_translator() under the zero-overhead exceptions model. The SEH handler chain and the zero-overhead exception stack are independent of each other, unlike the MS exceptions model where both share the same chain, so the zero-overhead exceptions model needs more help reconciling the fact that exceptions can be thrown from anywhere in the program.