5.42 Stack_protect Pragma

Use this pragma directive to force stack protection for the defined function that follows.
Note: For XC32, this attribute adds stack protection code to the function if flags -fstack-protector, -fstack-protector-strong or -fstack-protector-explicit are set.

Suggested Replacement

__attribute__((stack_protect))

Caveats

None.

Examples

Consider migrating IAR code such as:
#pragma stack_protect
to MPLAB XC codes similar to:
void __attribute__((stack_protect)) foo ()

Further Information

None.