fstack-security-check, GS

Causes the compiler to detect some buffer overruns.

IDE Equivalent

Windows: C/C++ > Code Generation > Buffer Security Check

Linux: None

Mac OS: None

Architectures

IA-32, Intel® EM64T

Syntax

Linux and Mac OS: -fstack-security-check
  -fno-stack-security-check
Windows:    /GS
     /GS-

Arguments

None

Default

/GS-      The compiler does not detect buffer overruns.
-fno-stack-security-check      The compiler does not detect buffer overruns.

Description

This option causes the compiler to generate code that detects some buffer overruns that overwrite the return address; this is a common technique for exploiting code that does not enforce buffer size restrictions. To use this option, you must also link with the Microsoft* 7.0 run-time support libraries.

Alternate Options

None