_CRT_SECURE_NO_WARNINGS
-
I am adapting for Visual C++ 2008 an old Borland C++ 4.5 program that contains many old-type string handling statements. The compiler tells me to "use _CRT_SECURE_NO_WARNINGS" to suppress warnings about strcpy and sprintf etc, but the online help gives no examples of its use. "#define _CRT_SECURE_NO_WARNINGS" has no effect. "_CRT_SECURE_NO_WARNINGS" (without quotes) alone on a line is treated as an undeclared variable. "#pragma _CRT_SECURE_NO_WARNINGS" causes a warning "unknown pragma". Please how do I put _CRT_SECURE_NO_WARNINGS in to suppress those warnings?
-
I am adapting for Visual C++ 2008 an old Borland C++ 4.5 program that contains many old-type string handling statements. The compiler tells me to "use _CRT_SECURE_NO_WARNINGS" to suppress warnings about strcpy and sprintf etc, but the online help gives no examples of its use. "#define _CRT_SECURE_NO_WARNINGS" has no effect. "_CRT_SECURE_NO_WARNINGS" (without quotes) alone on a line is treated as an undeclared variable. "#pragma _CRT_SECURE_NO_WARNINGS" causes a warning "unknown pragma". Please how do I put _CRT_SECURE_NO_WARNINGS in to suppress those warnings?
On my system (VS 2005), the following define (note: ends with DEPRECATE)
#define _CRT_SECURE_NO_DEPRECATE
works, while
#define _CRT_SECURE_NO_WARNINGS
not. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
-
I am adapting for Visual C++ 2008 an old Borland C++ 4.5 program that contains many old-type string handling statements. The compiler tells me to "use _CRT_SECURE_NO_WARNINGS" to suppress warnings about strcpy and sprintf etc, but the online help gives no examples of its use. "#define _CRT_SECURE_NO_WARNINGS" has no effect. "_CRT_SECURE_NO_WARNINGS" (without quotes) alone on a line is treated as an undeclared variable. "#pragma _CRT_SECURE_NO_WARNINGS" causes a warning "unknown pragma". Please how do I put _CRT_SECURE_NO_WARNINGS in to suppress those warnings?
Anthony Appleyard wrote:
Please how do I put _CRT_SECURE_NO_WARNINGS in to suppress those warnings?
I put this in Project Properties --> C/C++ --> Preprocessor definitions.
Maxwell Chen
-
I am adapting for Visual C++ 2008 an old Borland C++ 4.5 program that contains many old-type string handling statements. The compiler tells me to "use _CRT_SECURE_NO_WARNINGS" to suppress warnings about strcpy and sprintf etc, but the online help gives no examples of its use. "#define _CRT_SECURE_NO_WARNINGS" has no effect. "_CRT_SECURE_NO_WARNINGS" (without quotes) alone on a line is treated as an undeclared variable. "#pragma _CRT_SECURE_NO_WARNINGS" causes a warning "unknown pragma". Please how do I put _CRT_SECURE_NO_WARNINGS in to suppress those warnings?
Also, maybe take a look at this: Security Enhancements in the CRT[^] Mark
Mark Salsbery Microsoft MVP - Visual C++ :java: