[vtk-developers] Visual Studio 8 "insecure method" warnings

David Gobbi dgobbi at atamai.com
Thu Feb 16 10:30:52 EST 2006


Hi Bill,

Thanks, I can add this to the VTK CMakeLists as well.  That way only 
cleaning
up the header files will be necessary.  The place we are seeing the 
warnings is
in IGSTK, for which we have a policy of not disabling any valid warnings.

 - David


William A. Hoffman wrote:

>For CMake, we do this, in the top level cmakelist file:
>
># Disable deprecation warnings for standard C functions.
>IF(CMAKE_COMPILER_2005)
>  ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
>ENDIF(CMAKE_COMPILER_2005)
>
>
>At 05:30 PM 2/15/2006, David Gobbi wrote:
>  
>
>>Hi Everyone,
>>
>>The VC++ 8.0 compiler warns about methods like strcpy, sscanf, sprintf,
>>because they lead to insecure code.  The microsoft documentation on the
>>issues is here:
>>http://msdn.microsoft.com/msdnmag/issues/05/05/SafeCandC/default.aspx
>>though we can't use their microsoft-specific solution.
>>
>>I have modified the VTK .h files so that packages can be built against
>>VTK without these warnings showing up, and will be checking in the
>>changes tomorrow morning.  The vtkSetString() macro in vtkSetGet.h was
>>the main offender.
>>
>>There are plenty of uses of strcpy in the .cxx files, too.  I've added
>>a bug report (#2889) to cover this.
>>
>>- David
>>
>>
>>_______________________________________________
>>vtk-developers mailing list
>>vtk-developers at vtk.org
>>http://www.vtk.org/mailman/listinfo/vtk-developers
>>    
>>
>
>
>  
>




More information about the vtk-developers mailing list