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

Luis Ibanez luis.ibanez at kitware.com
Sat Jun 9 18:25:47 EDT 2007



Hi Zein,

Actually, after looking again, we do define this flag
in the top CMakeLists.txt file of ITK.

The flag was added on August 23 2005, so it has been
there for a while.

Look at lines 8 to 31 of the top CMakeLists.txt file.


What version of ITK are you using ?



    Thanks


       Luis



-----------------
Zein Salah wrote:
> Hello Luis,
>  
> yes, I am using CMake 2.4.6 for configuring for Visual Studio 2005. 
> Strangely, CMake does NOT  add this option to the CMakeCache!
> Maybe I should add it manually?
>  
> thanks,
> Zein
> 
>     -----Ursprüngliche Nachricht-----
>     *Von:* Luis Ibanez [mailto:luis.ibanez at kitware.com]
>     *Gesendet:* Sa 09.06.2007 23:08
>     *An:* Sean McBride
>     *Cc:* Zein Salah; insight-users at itk.org
>     *Betreff:* Re: [Insight-users] So many warnings after moving with
>     ITK to VS 2005
> 
> 
>     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