Select Page

I was recently trying to modify an open source FTP client in Visual C++ 2005. The software was written for an earlier version of VC++ so it had to be imported into the 2005 version. The import process generated hundreds of warnings of deprecated functions. This is not really something you want to see when compiling a program.

The warnings were the result of Microsoft deprecating many standard C functions. The complete list can be found on MSDN. These functions are being removed due to security concerns that Microsoft has. The new function has “_s” appended to it’s name, for example, printf becomes printf_s.
One might think that all you have to do is a global search and replace throughout your project to change the function names, but this won’t work. The updated functions have different parameter lists and return types.
So you can spend hours or days manually updating all of your code, or you can tell the compiler to use the deprecated functions instead. This can be done by placing the following at the start of your program:

#define _CRT_SECURE_NO_DEPRECATE

Keep in mind that this is a temporary solution. There may come a time when Microsoft removes these deprecated functions completely but at least you have time to gradually update the functions to their more secure counterparts.

Print Friendly, PDF & Email
Translate ยป