Turn off warning for fill_n on MSVC

MSVC has a warning for using "unsafe" algorithms such as fill_n that can
easily overrun the end of unchecked pointers. The problem is that there
are lots of valid uses of these algorithms, and the signal that this is
a valid use is MSVC-specific. Even less fortunate is the fact that if
another header violates the warning, it is impossible to suppress it
because it happens in a system header file (xutility), which was included
far before the actual offending code occured. Even less fortunate than
that, a boost header we (indirectly) use sets off this warning, cannot
be suppressed, and is not going to be fixed
(https://svn.boost.org/trac/boost/ticket/11426). The best solution is to
turn off this problematic warning for everybody.
This commit is contained in:
Kenneth Moreland 2016-05-04 07:58:25 -06:00
parent 0af7188708
commit e27e955931

@ -259,11 +259,25 @@ VTKM_THIRDPARTY_POST_INCLUDE
# error Both VTKM_USE_VARIADIC_TEMPLATE and VTKM_NO_VARIADIC_TEMPLATE defined. Do not know what to do.
#endif
#ifdef VTKM_MSVC
//With MSVC the types that we generate cause warning C4503 (long symbol names)
//this doesn't affect the resulting binary so we just supress that warning
//
#ifdef VTKM_MSVC
#pragma warning(disable:4503)
//MSVC has a warning for using "unsafe" algorithms such as fill_n that can
//easily overrun the end of unchecked pointers. The problem is that there
//are lots of valid uses of these algorithms, and the signal that this is
//a valid use is MSVC-specific. Even less fortunate is the fact that if
//another header violates the warning, it is impossible to suppress it
//because it happens in a system header file (xutility), which was included
//far before the actual offending code occured. Even less fortunate than
//that, a boost header we (indirectly) use sets off this warning, cannot
//be suppressed, and is not going to be fixed
//(https://svn.boost.org/trac/boost/ticket/11426). The best solution is to
//turn off this problematic warning for everybody.
//
#pragma warning(disable:4996)
#endif
#endif //vtkm_internal_Configure_h