c++ – How to use _CRT_SECURE_NO_WARNINGS

c++ – How to use _CRT_SECURE_NO_WARNINGS

Add by

Configuration Properties>>C/C++>>Preporocessor>>Preprocessor


Under Project -> Properties -> C/C++ -> Preprocessor -> Preprocessor Definitions add _CRT_SECURE_NO_WARNINGS

c++ – How to use _CRT_SECURE_NO_WARNINGS

If your are in Visual Studio 2012 or later this has an additional setting SDL checks Under Property Pages -> C/C++ -> General

Additional Security Development Lifecycle (SDL) recommended checks; includes enabling additional secure code generation features and extra security-relevant warnings as errors.

It defaults to YES – For a reason, I.E you should use the secure version of the strncpy. If you change this to NO you will not get a error when using the insecure version.

SDL checks in vs2012 and later

Leave a Reply

Your email address will not be published.