0

I'm porting an old project from Boost 1.48 to Boost 1.61. The project is compiled using MSVC 2013. There are several reported errors during build which I think are boost related but unfortunately the bug reports are not very helpful at all.

3>  entry.cpp
4>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility(2715): error C2220: warning treated as error - no 'object' file generated
4>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility(2715): warning C4996: 'std::_Fill_n': 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'
4>          c:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility(2701) : see declaration of 'std::_Fill_n'
4>          c:\boost\boost_1_61_0\boost\random\detail\polynomial.hpp(114) : see reference to function template instantiation '_OutIt std::fill_n<boost::random::detail::polynomial_ops::digit_t*,size_t,boost::random::detail::polynomial_ops::digit_t>(_OutIt,_Diff,const _Ty &)' being compiled
4>          with
4>          [
4>              _OutIt=boost::random::detail::polynomial_ops::digit_t *
4>  ,            _Diff=size_t
4>  ,            _Ty=boost::random::detail::polynomial_ops::digit_t
4>          ]

I cannot see anything in the above that helps me identify where the problem is, there are no line numbers and the snippet of code is not from the compiled file.

SPlatten
  • 5,334
  • 11
  • 57
  • 128
  • Have you tried `-D_SCL_SECURE_NO_WARNINGS`? – Eljay Jul 02 '20 at 12:58
  • @Eljay, no what does that do? – SPlatten Jul 02 '20 at 13:01
  • 2
    From the compiler's output: "To disable this warning, use `-D_SCL_SECURE_NO_WARNINGS`. See documentation on how to use Visual C++ 'Checked Iterators'" – Eljay Jul 02 '20 at 13:12
  • @Eljay, does it have a human readable text option I could locate in the IDE? – SPlatten Jul 02 '20 at 13:42
  • 1
    Not sure. I program on Windows using Vim with Microsoft's CL.EXE; I don't use the IDE. – Eljay Jul 02 '20 at 13:50
  • 1
    @SPlatten No there's not just a checkbox you can check. Instead, you need to go into the project properties, go to the preprocessor page, and add it to the "Preprocessor definitions" line. Don't include the `-D`, and separate from existing options with a semicolon. – Arthur Tacca Jul 02 '20 at 14:37

1 Answers1

1

@Eljay, does it have a human readable text option I could locate in the IDE? – SPlatten 43 mins ago

The thing you posted IS human readable text. It actually describes a warning with a reference to documentation. ¯\(ツ)/¯ Maybe you can just tell the compiler you don't want to receive warnings

In addition, you can use the keywords to google additional information:

C++ Boost: what's the cause of this warning?

Many libraries in addition already have a warning-suppression header (look for e.g. boost/iostreams/detail/config/disable_warnings.hpp or boost/random/detail/disable_warnings.hpp). The fact that known benign warnings "slip through" might indicate that the library needs to update their suppressions, OR you might need to upgrade your boost version.

sehe
  • 374,641
  • 47
  • 450
  • 633