How do I generate pure code (without runtime checks) in VC++ 2010 Express ? For example I removed Buffer Security Check ( set compile opt /GS-), but in my code I again saw these calls
call __security_init_cookie ... call _RTC_CheckEsp ... call _RTC_CheckEsp ...
How do I remove these calls?
The MSVC docs indicate that
__security_init_cookieis called by the CRT runtime for “code compiled with /GS (Buffer Security Check) and in code that uses exception handling” (emphasis added). See http://msdn.microsoft.com/en-us/library/ms235362%28v=VS.100%29.aspxI wouldn’t be surprised if there’s code in the runtime library itself that depends on the security cookie having been initialized, whether your code uses it or not (in other words, the runtime library code may have been compiled with /GS, and if so, it needs the cookie initialized whether or not your code does).
As for the
_RTC_CheckEspcall – that should be controlled by the/RTCsor the/RTC1option. Remove those options from your build and there should be no calls to_RTC_CheckEsp.