[Insight-users] So many warnings after moving with ITK to VS 2005
Sean McBride
sean at rogue-research.com
Fri Jun 8 10:45:02 EDT 2007
On 2007-06-08 14:27, Zein Salah said:
>After I upgrade my environment to Visual Studio 2005, I am getting -by
>compiling my programs- a long list of warnings. Most are like the one below
>
>
>
>D:\InsightApplications320\Auxiliary\FltkImageViewer\SliceView.h(492) :
>warning C4996: 'sprintf' was declared deprecated
> C:\Program Files\Microsoft Visual Studio 8\VC\include
>\stdio.h(345) : see declaration of 'sprintf'
> Message: 'This function or variable may be unsafe. Consider
>using sprintf_s instead. To disable deprecation, use
>_CRT_SECURE_NO_DEPRECATE. See online help for details.'
>
>Can I do anything against this? Is there something I should correct? Or
>I can simply ignore these warnings?
The message suggests a solution: use _CRT_SECURE_NO_DEPRECATE to
suppress the warning. However, the warning is quite correct, sprintf()
is evil and should never be used. The best thing to do, if you are so
inclined, is to fix ITK and supply a patch to kitware. However, I think
snprintf() is a better solution than sprintf_s(), as the latter is not
portable.
--
____________________________________________________________
Sean McBride, B. Eng sean at rogue-research.com
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
More information about the Insight-users
mailing list