mirror of
https://github.com/boostorg/conversion.git
synced 2025-07-30 12:37:24 +02:00
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:
@ -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)
|
||||||
|
@ -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
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -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()
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user