标 题: [合集] vc中用了标准c函数比如strcpy等出现警告提示
发信站: 水木社区 (Mon Jan 22 10:28:14 2007), 站内
☆─────────────────────────────────────☆
moon783 (moon783) 于 (Wed Jan 17 11:44:03 2007) 提到:
warning C4996: ’strcpy’ was declared deprecated
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\string.h(73) :
see declaration of ’strcpy’
Message: ’This function or variable may be unsafe. Consider using
strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See
online help for details.’
这是为什么?难道vc对标准的支持不够?
☆─────────────────────────────────────☆
longda (龙?) 于 (Wed Jan 17 11:53:32 2007) 提到:
这就叫强奸标准。不过,vc的建议也是有道理的。
【 在 moon783 (moon783) 的大作中提到: 】
: warning C4996: ’strcpy’ was declared deprecated
: C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\string.h(73) :
see declaration of ’strcpy’
: Message: ’This function or variable may be unsafe. Consider using
strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See
online help for details.’
: ...................
☆─────────────────────────────────────☆
rokingphone (鑫森淼焱? ????? ???) 于 (Wed Jan 17 12:53:46 2007) 提到
这是VS2005安全性的体现。
建议使用strcpy_s
【 在 moon783 (moon783) 的大作中提到: 】
: warning C4996: ’strcpy’ was declared deprecated
: C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\string.h(73) :
see declaration of ’strcpy’
: Message: ’This function or variable may be unsafe. Consider using
strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See
online help for details.’
: ...................
☆─────────────────────────────────────☆
thinstrong (南夜侯) 于 (Wed Jan 17 12:58:54 2007) 提到:
strncpy
【 在 rokingphone (鑫森淼焱? ????? ???) 的大作中提到: 】
: 这是VS2005安全性的体现。
: 建议使用strcpy_s
☆─────────────────────────────────────☆
rokingphone (鑫森淼焱? ????? ???) 于 (Wed Jan 17 13:00:56 2007) 提到
这个也要用strncpy_s
【 在 thinstrong (南夜侯) 的大作中提到: 】
: strncpy
☆─────────────────────────────────────☆
flybb (zz) 于 (Wed Jan 17 13:07:53 2007) 提到:
这个截断了不加\0
很讨厌
【 在 thinstrong (南夜侯) 的大作中提到: 】
: strncpy
☆─────────────────────────────────────☆
UMU (小开) 于 (Wed Jan 17 14:17:25 2007) 提到:
不要使用任何所谓的标准库里的字符处理函数,基本上都是不安全的
用
StringCchCopyN, StringCbCopyNEx, StringCbCopy
【 在 moon783 (moon783) 的大作中提到: 】
: warning C4996: ’strcpy’ was declared deprecated
: C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\string.h(73) :
see declaration of ’strcpy’
: Message: ’This function or variable may be unsafe. Consider using
strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See
online help for details.’
: ...................
☆─────────────────────────────────────☆
launching (...) 于 (Thu Jan 18 19:39:20 2007) 提到:
因为标准的C里字符串处理函数不安全,很容易出问题
【 在 moon783 (moon783) 的大作中提到: 】
: warning C4996: ’strcpy’ was declared deprecated
: C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\string.h(73) :