Deprecating Functions in Visual C++ 2005

Posted by Johan Cyprich on 07 May 2007 | Tagged as: Programming

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.



Tweet This Tweet This Post!

Related posts:
    Problems Installing the DotNetNuke StarterKit
    Visual Studio 2005 Express Now Free
    Hidden Visual Studio 2005 Image Library
    Importing and Exporting with SQL Server 2005 Express

Share this post:

del.icio.us:Deprecating Functions in Visual C++ 2005 digg:Deprecating Functions in Visual C++ 2005 spurl:Deprecating Functions in Visual C++ 2005 wists:Deprecating Functions in Visual C++ 2005 simpy:Deprecating Functions in Visual C++ 2005 newsvine:Deprecating Functions in Visual C++ 2005 blinklist:Deprecating Functions in Visual C++ 2005 furl:Deprecating Functions in Visual C++ 2005 reddit:Deprecating Functions in Visual C++ 2005 fark:Deprecating Functions in Visual C++ 2005 blogmarks:Deprecating Functions in Visual C++ 2005 Y!:Deprecating Functions in Visual C++ 2005 smarking:Deprecating Functions in Visual C++ 2005 magnolia:Deprecating Functions in Visual C++ 2005 segnalo:Deprecating Functions in Visual C++ 2005 gifttagging:Deprecating Functions in Visual C++ 2005

Follow Me:

Did you find this post interesting and useful? You can keep up to date on this blog by subscribing to my RSS feed, or you can have new posts sent to you by e-mail. You can also follow me on Twitter.


Trackback This Post | Subscribe to the comments through RSS Feed

Leave a Reply

CommentLuv Enabled