[Insight-users] So many warnings after moving with ITK to VS 2005

Luis Ibanez luis.ibanez at kitware.com
Sat Jun 9 17:08:58 EDT 2007


Hi Zein,

What version of CMake are you using ?

CMake 2.4.6 automatically adds the option

       _CRT_SECURE_NO_DEPRECATE

to the CMakeCache when configuring for
Visual Studio 2005.


As you will see, the warning that you find do not
happen in the ITK Dashboard, where we have several
VS2005 submissions.


   Regards,


     Luis




---------------------
Sean McBride wrote:
> 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.
> 


More information about the Insight-users mailing list