diff --git a/lexical_cast_test.cpp b/lexical_cast_test.cpp index 12e9deb..a994d13 100644 --- a/lexical_cast_test.cpp +++ b/lexical_cast_test.cpp @@ -11,6 +11,13 @@ // // Note: The unit test no longer compile on MSVC 6, but lexical_cast itself works for it. +// +// We need this #define before any #includes: otherwise msvc will emit warnings +// deep within std::string, resulting from our (perfectly legal) use of basic_string +// with a custom traits class: +// +#define _SCL_SECURE_NO_WARNINGS + #include #if defined(__INTEL_COMPILER) diff --git a/numeric_cast_test.cpp b/numeric_cast_test.cpp index 0b5bcde..51393b9 100644 --- a/numeric_cast_test.cpp +++ b/numeric_cast_test.cpp @@ -28,7 +28,7 @@ using namespace boost; using std::cout; -int test_main( int argc, char * argv[] ) +int test_main( int , char * [] ) { # ifdef NDEBUG diff --git a/test/implicit_cast.cpp b/test/implicit_cast.cpp index e18e17a..8c3bc52 100644 --- a/test/implicit_cast.cpp +++ b/test/implicit_cast.cpp @@ -28,5 +28,11 @@ int main() type f = check_return(boost::implicit_cast("hello")); type z = check_return(boost::implicit_cast(foo("hello"))); + + // warning supression: + (void)x; + (void)f; + (void)z; + return boost::report_errors(); } diff --git a/test/implicit_cast_fail.cpp b/test/implicit_cast_fail.cpp index 80143da..a7867a1 100644 --- a/test/implicit_cast_fail.cpp +++ b/test/implicit_cast_fail.cpp @@ -19,4 +19,6 @@ struct foo int test_main(int, char*[]) { foo x = implicit_cast("foobar"); + (void)x; // warning suppression. + return 0; } diff --git a/test/lexical_cast_abstract_test.cpp b/test/lexical_cast_abstract_test.cpp index 207d3a5..4b92e49 100644 --- a/test/lexical_cast_abstract_test.cpp +++ b/test/lexical_cast_abstract_test.cpp @@ -51,7 +51,7 @@ std::ostream &operator<<(std::ostream &O, const A &a) { a.out(O); return O; -}; +} void test_abstract() {