Run-time error checks are a way for you to find problems in your running code; for more information, see How to: Use Native Run-Time Checks.
If you compile your program at the command line using any of the /RTC compiler options, any pragma optimize instructions in your code will silently fail. This is because run-time error checks are not valid in a release (optimized) build.
You should use /RTC for development builds; /RTC should not be used for a retail build. /RTC cannot be used with compiler optimizations (/O Options (Optimize Code)). A program image built with /RTC will be slightly larger and slightly slower than an image built with /Od (up to 5 percent slower than an /Od build).
The __MSVC_RUNTIME_CHECKS preprocessor directive will be defined when you use any /RTC option or /GZ.
To set this compiler option in the Visual Studio development environment
-
Open the project's Property Pages dialog box. For details, see How to: Open Project Property Pages.
-
Click the C/C++ folder.
-
Click the Code Generation property page.
-
Modify one or both of the following properties: Basic Runtime Checks or Smaller Type Check.
To set this compiler option programmatically