查看单个帖子
旧 2009-05-07, 06:38 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】vs 2005 Generates Warning 4996 When Compiling Exhostappserv

vs 2005 generates warning #4996 when compiling exhostappserv
vs 2005 generates warning #4996 when compiling exhostappservices.cpp
we have included and made slight modifications to exhostappservices.cpp in our application. we just updated to dwgdirect v. 2.1.0. when exhostappservices.cpp is compiled, the vs 2005 compiler generates warning 4996 when calling odsprintf() in exhostappservices::meterprogress(). this is occuring because odsprintf() is a typedef for _snwprintf(). _snwprintf() has been deprecated in the microsoft vs 8 crt. see the link below for possible remedies. it would be nice if odsprintf referred to the secure version of _snprintf().
_snwprintf and _snwprintf_s have different signatures, so odsprintf cannot refer to _snwprintf_s - it would break code portability.
actually, there shouldn't be 4996 warning, because _crt_secure_no_deprecate is defined in dd headers (odplatformsettings.h,38), but vc compiler seem to forget it sometimes.
vladimir
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)