From c956e2510b62ed5bc9465a7c0a756431a6c5a010 Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 14 Jan 2015 15:20:51 +0100 Subject: [PATCH] Re-enable MSVC warning 4307. --- test/SolidityEndToEndTest.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/SolidityEndToEndTest.cpp b/test/SolidityEndToEndTest.cpp index 16787c8e7..b79e9c4b7 100644 --- a/test/SolidityEndToEndTest.cpp +++ b/test/SolidityEndToEndTest.cpp @@ -28,10 +28,6 @@ #include #include -#ifdef _MSC_VER -#pragma warning(disable: 4307) //integral constant overflow for high_bits_cleaning -#endif - using namespace std; namespace dev @@ -386,7 +382,8 @@ BOOST_AUTO_TEST_CASE(high_bits_cleaning) { char const* sourceCode = "contract test {\n" " function run() returns(uint256 y) {\n" - " uint32 x = uint32(0xffffffff) + 10;\n" + " uint32 t = uint32(0xffffffff);\n" + " uint32 x = t + 10;\n" " if (x >= 0xffffffff) return 0;\n" " return x;" " }\n" @@ -394,7 +391,8 @@ BOOST_AUTO_TEST_CASE(high_bits_cleaning) compileAndRun(sourceCode); auto high_bits_cleaning_cpp = []() -> u256 { - uint32_t x = uint32_t(0xffffffff) + 10; + uint32_t t = uint32_t(0xffffffff); + uint32_t x = t + 10; if (x >= 0xffffffff) return 0; return x; @@ -426,14 +424,16 @@ BOOST_AUTO_TEST_CASE(small_unsigned_types) { char const* sourceCode = "contract test {\n" " function run() returns(uint256 y) {\n" - " uint32 x = uint32(0xffffff) * 0xffffff;\n" + " uint32 t = uint32(0xffffff);\n" + " uint32 x = t * 0xffffff;\n" " return x / 0x100;" " }\n" "}\n"; compileAndRun(sourceCode); auto small_unsigned_types_cpp = []() -> u256 { - uint32_t x = uint32_t(0xffffff) * 0xffffff; + uint32_t t = uint32_t(0xffffff); + uint32_t x = t * 0xffffff; return x / 0x100; }; testSolidityAgainstCpp("run()", small_unsigned_types_cpp);