Index: test_tools_test.cpp =================================================================== --- test_tools_test.cpp (revision 57451) +++ test_tools_test.cpp (working copy) @@ -503,7 +503,7 @@ //____________________________________________________________________________// struct A { - friend std::ostream& operator<<( std::ostream& str, A const& a ) { str << "struct A"; return str;} + friend std::ostream& operator<<( std::ostream& str, A const& ) { str << "struct A"; return str;} }; TEST_CASE( test_BOOST_TEST_MESSAGE ) Index: boost_check_equal_str.cpp =================================================================== --- boost_check_equal_str.cpp (revision 57451) +++ boost_check_equal_str.cpp (working copy) @@ -19,8 +19,8 @@ { char const* buf_ptr_cch = "abc"; char const buf_array_cch[] = "abc"; - char* buf_ptr_ch = "abc"; char buf_array_ch[] = "abc"; + char* buf_ptr_ch = buf_array_ch; std::string buf_str = "abc"; BOOST_CHECK_EQUAL(buf_ptr_cch, buf_ptr_cch); Index: foreach_test.cpp =================================================================== --- foreach_test.cpp (revision 57451) +++ foreach_test.cpp (working copy) @@ -20,6 +20,10 @@ #include +#ifdef BOOST_MSVC +#pragma warning(disable:4702) // Unreachable code +#endif + template void baz( std::listconst& list_of_T ) { Index: result_report_test.cpp =================================================================== --- result_report_test.cpp (revision 57451) +++ result_report_test.cpp (working copy) @@ -58,6 +58,7 @@ void very_bad_foo() { log_guard lg; + (void)lg; // Warning suppression, it is used and needed really! onullstream_type null_out; unit_test_log.set_stream( null_out ); BOOST_FAIL( "" ); @@ -105,6 +106,7 @@ BOOST_AUTO_TEST_CASE( test_result_reports ) { guard G; + (void)G; // Waring suppression, it is used and needed really! #define PATTERN_FILE_NAME "result_report_test.pattern" Index: ../../../boost/test/unit_test_log_formatter.hpp =================================================================== --- ../../../boost/test/unit_test_log_formatter.hpp (revision 57451) +++ ../../../boost/test/unit_test_log_formatter.hpp (working copy) @@ -103,7 +103,7 @@ // for backward compatibility log_exception( os, cd, ex.what() ); } - virtual void log_exception( std::ostream&, log_checkpoint_data const&, const_string explanation ) {} + virtual void log_exception( std::ostream&, log_checkpoint_data const&, const_string /*explanation*/ ) {} virtual void log_entry_start( std::ostream&, log_entry_data const&, log_entry_types let ) = 0; virtual void log_entry_value( std::ostream&, const_string value ) = 0; Index: ../../../boost/test/impl/execution_monitor.ipp =================================================================== --- ../../../boost/test/impl/execution_monitor.ipp (revision 57451) +++ ../../../boost/test/impl/execution_monitor.ipp (working copy) @@ -788,7 +788,14 @@ ::alarm( 0 ); #ifdef BOOST_TEST_USE_ALT_STACK - stack_t sigstk = {}; +#ifdef __GNUC__ + // We shouldn't need to explicitly initialize all the members here, + // but gcc warns if we don't, so add initializers for each of the + // members specified in the POSIX std: + stack_t sigstk = { 0, 0, 0, }; +#else + stack_t sigstk = { }; +#endif sigstk.ss_size = MINSIGSTKSZ; sigstk.ss_flags = SS_DISABLE; @@ -1127,7 +1134,7 @@ execution_monitor::catch_signals( unit_test::callback0 const& F ) { _invalid_parameter_handler old_iph = _invalid_parameter_handler(); - BOOST_TEST_CRT_HOOK_TYPE old_crt_hook; + BOOST_TEST_CRT_HOOK_TYPE old_crt_hook = 0; if( !p_catch_system_errors ) _set_se_translator( &detail::seh_catch_preventer ); Index: ../../../boost/test/utils/runtime/env/environment.ipp =================================================================== --- ../../../boost/test/utils/runtime/env/environment.ipp (revision 57451) +++ ../../../boost/test/utils/runtime/env/environment.ipp (working copy) @@ -75,6 +75,13 @@ //____________________________________________________________________________// +#ifdef BOOST_MSVC +// Suppress warning: +// warning C4996: 'getenv': This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. +#pragma warning(push) +#pragma warning(disable:4996) +#endif + BOOST_RT_PARAM_INLINE cstring sys_read_var( cstring var_name ) { @@ -82,6 +89,10 @@ return BOOST_RT_PARAM_GETENV( var_name.begin() ); } +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + //____________________________________________________________________________// BOOST_RT_PARAM_INLINE void Index: ../../../boost/test/utils/runtime/config.hpp =================================================================== --- ../../../boost/test/utils/runtime/config.hpp (revision 57451) +++ ../../../boost/test/utils/runtime/config.hpp (working copy) @@ -67,6 +67,13 @@ typedef std::basic_ostream out_stream; #endif +#ifdef BOOST_MSVC +// suppress warning +// warning C4996: 'putenv': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _putenv. See online help for details. +#pragma warning(push) +#pragma warning(disable:4996) +#endif + #ifndef UNDER_CE #if defined(__COMO__) && 0 inline void @@ -92,6 +99,10 @@ #endif #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + #define BOOST_RT_PARAM_LITERAL( l ) l #define BOOST_RT_PARAM_CSTRING_LITERAL( l ) cstring( l, sizeof( l ) - 1 ) #define BOOST_RT_PARAM_GETENV getenv Index: ../../../boost/test/utils/basic_cstring/basic_cstring.hpp =================================================================== --- ../../../boost/test/utils/basic_cstring/basic_cstring.hpp (revision 57451) +++ ../../../boost/test/utils/basic_cstring/basic_cstring.hpp (working copy) @@ -548,7 +548,7 @@ --it; } - return it == last ? npos : it - begin(); + return it == last ? static_cast(npos) : static_cast(it - begin()); } //____________________________________________________________________________//