From ab178b8bac600562b9dadc529846a263efc14463 Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 15 Mar 2017 11:10:24 +0100 Subject: Mention 'transfer' in warning about unchecked 'send'. --- libsolidity/analysis/TypeChecker.cpp | 5 +++-- test/libsolidity/SolidityNameAndTypeResolution.cpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index 8e7ec29b..512493cd 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -891,10 +891,11 @@ void TypeChecker::endVisit(ExpressionStatement const& _statement) if ( location == Location::Bare || location == Location::BareCallCode || - location == Location::BareDelegateCall || - location == Location::Send + location == Location::BareDelegateCall ) warning(_statement.location(), "Return value of low-level calls not used."); + else if (location == Location::Send) + warning(_statement.location(), "Failure condition of 'send' ignored. Consider using 'transfer' instead."); } } } diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index 27791775..97a82f00 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -4420,7 +4420,7 @@ BOOST_AUTO_TEST_CASE(unused_return_value_send) } } )"; - CHECK_WARNING(text, "Return value of low-level calls not used"); + CHECK_WARNING(text, "Failure condition of 'send' ignored. Consider using 'transfer' instead."); } BOOST_AUTO_TEST_CASE(unused_return_value_call) -- cgit