Migration from Visual C++ 6.0 to 2005 – Part III
After dealing with all errors given the compiler and having compiled several of our modules I started looking for the compiler warnings and chasing them down. In this article and will try to show some of the warnings that I encountered and how he dealt with them.
Links:
Migration from Visual C++ 6.0 to 2005 – Part I
Migration from Visual C++ 6.0 to 2005 – Part II
Warnings for deprecated functions
Several functions from the CRT library have been deprecated. Functions like strcpy, strcat, etc. have been deprecated as “insecure” and apparently new functions have been created adding “_s” at the end. The new functions do not have the same signature as the “non secure ones”. Of course changing the code to use the new names would be breaking with the VC++ 6.0 compile. Fortunately if you define _CRT_SECURE_NO_DEPRECATE (I have put it in the project preprocessor settings) the warnings stop appearing.
Warnings for non-standard usage of some functions
Some functions now give warnings if used. In the new compiler they have added “_” in front of the function name, which VC++ 6.0 accepts as well. Some examples include strdup now _strdup, strcmp now _strcmp, etc. Since all these work with VC++ 6.0 I did a global replace
.