[Insight-developers] std::_Copy_impl warning when building against ITK with MSVC 2010

David Doria daviddoria at gmail.com
Wed Nov 7 19:38:35 EST 2012


On Sun, Sep 16, 2012 at 9:52 AM, David Doria <daviddoria at gmail.com> wrote:

> When I build even something very very simple like this with the MSVC
> 2010 compiler:
>
> #include "itkImage.h"
> #include "itkImageFileReader.h"
>
> int main(int argc, char *argv[])
> {
>   typedef itk::Image< double, 2 >         ImageType;
>   typedef itk::ImageFileReader<ImageType> ReaderType;
>
>   ReaderType::Pointer reader = ReaderType::New();
>   reader->SetFileName(argv[1]);
>   reader->Update();
>
>   return EXIT_SUCCESS;
> }
>
>
> I get:
>
> ----------------------
> C:\Program Files\Microsoft Visual Studio
> 10.0\VC\INCLUDE\xutility:2227: warning: C4996: 'std::_Copy_impl':
> Function call with parameters that may be unsafe - this call relies on
> the caller to check that the passed values are correct. To disable
> this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how
> to use Visual C++ 'Checked Iterators'
>
> C:\Program Files\Microsoft Visual Studio
> 10.0\VC\INCLUDE\xutility:2212: see declaration of 'std::_Copy_impl'
>
> c:\src\itk\modules\io\imagebase\include\itkImageFileReader.hxx:440:
> see reference to function template instantiation '_OutIt
> std::copy<const double*,double*>(_InIt,_InIt,_OutIt)' being compiled
> with
> [
>     _OutIt=double *,
>     _InIt=const double *
> ]
>
> c:\src\itk\modules\io\imagebase\include\itkImageFileReader.hxx:353:
> while compiling class template member function 'void
> itk::ImageFileReader<TOutputImage>::GenerateData(void)'
> with
> [
>     TOutputImage=ImageType
> ]
>
> C:\src\TestITK\TestITK.cxx:9: see reference to class template
> instantiation 'itk::ImageFileReader<TOutputImage>' being compiled
> with
> [
>     TOutputImage=ImageType
> ]
> ----------------------
>
> Has anyone seen this? Is this D_SCL_SECURE_NO_WARNINGS something that
> should be added to ITKSetStandardCompilerFlags.cmake? Or is there a
> better explanation?
>
> Thanks,
>
> David
>

Any thoughts on this?

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-developers/attachments/20121107/d1bae64b/attachment.htm>


More information about the Insight-developers mailing list