17.2.27 Stack_protector Function Attribute
The
stack_protector attribute adds stack protection code to the
function if one of the following options is set:
-fstack-protector,
-fstack-protector-strong, or
-fstack-protector-explicit. For
example:void __attribute__ ((stack_protector)) foo(void);Optimizations can affect stack protection in the following ways:
- Function inlining can affect whether a function is protected.
- Removal of an unused variable can prevent a function from being protected.
The no_stack_protector attribute can alternatively be used to
disable protection for the specified function, even when one of the stack
protection options has been issued.
