warning C4996: 'strcpy' was declared deprecated
来源:互联网 发布:vue.js设置button隐藏 编辑:程序博客网 时间:2024/05/19 00:16
VC8 編譯出現 warning C4996: 'strcpy' was declared deprecated
最近使用 VC8 編譯一個 VC7 的 Project ,結果出現如下的 Warning
Warning 1 warning C4996: 'strcpy' was declared deprecated d:\20060922\lib\stunt_client_dll_win32\sample.cpp 67
查了 MSDN [1]才發現VC8 對於 CRT 加入許多安全性的函數,將內文節錄如下:
已加入數種函式的安全版本,這些函式會以較佳的方式處理錯誤,並強制執行較嚴格的緩衝控制,以避免發生常見的安全性缺失。新的安全版本可以利用 _s 後置字元加以識別。
現有較不安全的許多函式版本已經被取代,若要停用取代警告,請定義 _CRT_SECURE_NO_DEPRECATE。如需詳細資訊,請參閱 Security-Enhanced Versions of CRT Functions。
所以,依據上述說明,如果你要讓其他編譯器也能夠編譯該程式,可以定義_CRT_SECURE_NO_DEPRECATE 來抑制警告訊息,或是改用 VC8 新提供的 strcpy_s 函數。
參考資料:
[1] ms-help://MS.MSDNQTR.v80.cht/MS.MSDN.v80/MS.VisualStudio.v80.cht/dv_vcedit/html/1a82576b-7f39-48f5-98f3-4679bb9df36c.htm
[2] http://www.microsoft.com/taiwan/msdn/library/2005/Mar-2005/VisCExSecApps.htm
- warning C4996: strcpy was declared deprecated
- warning C4996: ''strcpy'' was declared deprecated
- warning C4996: 'strcpy' was declared deprecated
- VS2005 出现warning C4996: strcpy was declared deprecated
- visual studio 2005:warning C4996: strcpy was declared deprecated
- VS2005 出现warning C4996: strcpy was declared deprecated
- VS2005编译VC6的工程,warning C4996: strcpy was declared deprecated
- (转)出现这样的警告 warning C4996: strcpy was declared deprecated
- VS2005 出现警告warning C4996: strcpy was declared deprecated 的解决办法
- VC2005去掉烦人的warning C4996: '×××' was declared deprecated
- warning C4996: 'sprintf' was declared deprecated see declaration of 'sprintf'
- warning C4996: 'sprintf' was declared deprecated see declaration of 'sprintf'
- 《warning C4996: 'sprintf' was declared deprecated see declaration of 'sprintf'》
- Visual C++ Tips: warning C4996: 'stricmp' was declared deprecated
- 关于VS2003中的Warning:strcpy was declared deprecated.
- error C4996: 'avcodec_free_frame': was declared deprecated
- warning C4996: 'sprintf' was declared deprecated see declaration of 'sprintf' 的警告消除方法
- warning C4996: '_snprintf' was declared deprecated 警告信息的消除方法
- Windows下Postgres数据库自动备份
- 条件变量
- boost库安装
- 读书方法分享
- myeclipse下自建user library的方法
- warning C4996: 'strcpy' was declared deprecated
- 致我们这些浮躁的程序猿
- Android常用命令操作(继续更新)
- 每日编程6之单链表反转递归版本
- C#网络编程系列三:自定义Web服务器
- 商餐网
- MySQL查询优化:连接查询排序limit(join、order by、limit语句)
- 50多个开源PDF阅读编辑工具汇总
- Extjs4HtmlEditor图片上传插件