VC6.0升级到VS2005时,编译警告的对策
2009-08-11 16:21
302 查看
一、warning C4996警告类
1)warning C4996: 'sprintf': This function or variable may be unsafe.
Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.
顾名思义,只要在当前工程【属性页】的【配置属性】->【C/C++】->【预处理器】中增加_CRT_SECURE_NO_WARNINGS即可
2)warning C4996: 'getpid' was declared deprecated
d:/Program Files/Microsoft Visual Studio 8/VC/include/process.h(227) : see declaration of 'getpid'
Message: 'The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _getpid. See online help for details.'
只要在当前工程【属性页】的【配置属性】->【C/C++】->【预处理器】中增加_CRT_NONSTDC_NO_DEPRECATE即可
待续。。。
微软的说明,请参考:
Security Enhancements in the CRT :
http://msdn2.microsoft.com/en-us/library/8ef0s5kh(VS.80).aspx
Secure Template Overloads :
http://msdn2.microsoft.com/en-us/library/ms175759(VS.80).aspx
1)warning C4996: 'sprintf': This function or variable may be unsafe.
Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.
顾名思义,只要在当前工程【属性页】的【配置属性】->【C/C++】->【预处理器】中增加_CRT_SECURE_NO_WARNINGS即可
2)warning C4996: 'getpid' was declared deprecated
d:/Program Files/Microsoft Visual Studio 8/VC/include/process.h(227) : see declaration of 'getpid'
Message: 'The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _getpid. See online help for details.'
只要在当前工程【属性页】的【配置属性】->【C/C++】->【预处理器】中增加_CRT_NONSTDC_NO_DEPRECATE即可
待续。。。
微软的说明,请参考:
Security Enhancements in the CRT :
http://msdn2.microsoft.com/en-us/library/8ef0s5kh(VS.80).aspx
Secure Template Overloads :
http://msdn2.microsoft.com/en-us/library/ms175759(VS.80).aspx
相关文章推荐
- VC6.0升级到VS2005时,编译警告的对策
- VC6.0升级至VS2005 引发的一些问题
- VS2005编译之declared deprecated警告
- VS2005编译警告
- 【转】总结:升级到xcode4.2 iOS sdk 5.0旧版工程编译后出现的警告解决办法
- 《转》在VS2005下编译was declared deprecated警告
- VS2005编译之declared deprecated警告
- 项目从vs2005升级到vs2010,新编译的64位程序启动时找不到K32EnumProcesses
- 成功将log4cpp升级到了vs2005版本,总结下编译时报错及相应的解决方法
- DirectShow9在VS2005或vc6.0下编译出现问题的解决方法
- 代码从VS2003升级到VS2005的编译链接问题及解决方法
- 开发平台由VC6.0升级至VS2005,将碰到的问题
- 在VS2005下编译was declared deprecated警告
- 升级到xcode4.2 iOS sdk 5.0旧版工程编译后出现的警告解决办法
- (转)DirectShow9在VS2005或vc6.0下编译出现问题的解决方法
- 关于vc6.0使用libxml库编译遇警告warning LNK4049: 已导入本地定义的符号 _xmlFree的解决方法
- VC6.0使用Greta的工程在VS2005中编译出现的问题:C2079,LNK1123,CVT1100等等
- VS2005编译之declared deprecated警告
- 16种C语言编译警告(Warning)类型的解决方法
- iOS 手动忽略编译警告