Misc small fixes to suppress warnings.

Code should now be clean with msvc /W4 and gcc /Wall /Wextra -pedantic with the exception of one deliberate warning in one test.

[SVN r57510]
This commit is contained in:
John Maddock
2009-11-09 12:27:54 +00:00
parent febafb7cb8
commit fce9ad4e1b
5 changed files with 17 additions and 2 deletions

View File

@ -11,6 +11,13 @@
// //
// Note: The unit test no longer compile on MSVC 6, but lexical_cast itself works for it. // 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 <boost/config.hpp> #include <boost/config.hpp>
#if defined(__INTEL_COMPILER) #if defined(__INTEL_COMPILER)

View File

@ -28,7 +28,7 @@ using namespace boost;
using std::cout; using std::cout;
int test_main( int argc, char * argv[] ) int test_main( int , char * [] )
{ {
# ifdef NDEBUG # ifdef NDEBUG

View File

@ -28,5 +28,11 @@ int main()
type<foo> f = check_return(boost::implicit_cast<foo>("hello")); type<foo> f = check_return(boost::implicit_cast<foo>("hello"));
type<long> z = check_return(boost::implicit_cast<long>(foo("hello"))); type<long> z = check_return(boost::implicit_cast<long>(foo("hello")));
// warning supression:
(void)x;
(void)f;
(void)z;
return boost::report_errors(); return boost::report_errors();
} }

View File

@ -19,4 +19,6 @@ struct foo
int test_main(int, char*[]) int test_main(int, char*[])
{ {
foo x = implicit_cast<foo>("foobar"); foo x = implicit_cast<foo>("foobar");
(void)x; // warning suppression.
return 0;
} }

View File

@ -51,7 +51,7 @@ std::ostream &operator<<(std::ostream &O, const A &a)
{ {
a.out(O); a.out(O);
return O; return O;
}; }
void test_abstract() void test_abstract()
{ {