How do I disable deprecation in VC++ Express Edition?
-
Friday, July 27, 2007 10:43 PMHi everyone,
How do you disable the deprecation check in VC++ Express Edition?
Below is what I'm trying to do:
Code Snippetwarning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
How/where do I use _CRT_SECURE_NO_WARNINGS ?
I'm looking into using strcpy_s at the moment, but I would like to know the method to disable the warning, just to learn.
Thanks in advance!!
Kurt
All Replies
-
Sunday, July 29, 2007 2:54 AM
Allways happy to help a fellow wrestler...
Project properties->Configuration Properties->C/C++->Preprocessor->Preprocessor Definitions
Click on the elipses (...)
type any definitions you like separated by "\n"ie
_CRT_SECURE_NO_WARNINGS
hit OK.
enjoy the silence...
Robin -
Sunday, July 29, 2007 5:34 AMCool!
Thanks, Robin
-
Sunday, January 01, 2012 8:07 PM
By the way, to disable for just one file put this line before the line that causes the warning
#define _CRT_SECURE_NO_WARNINGS
If you want to turn off the POSIX deprecated warnings, put this line, too
#define _CRT_NONSTDC_NO_WARNINGS
And, of course, you can put these lines in a header file, such as "Warnings.h" and include at the top of files which you do not want those warnings:#include "Warnings.h"
Ron Lewis at Indinfer, Baltimore, Maryland, United States -
Tuesday, March 27, 2012 10:20 PM
Use
#pragma warning(disable: 4996)
Fabio Menezes
-
Sunday, March 10, 2013 1:25 AMThanks it work for me !
Suresh Dinde

