diff options
author | chriseth <chris@ethereum.org> | 2017-03-15 18:41:40 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-15 18:41:40 +0800 |
commit | 6258fe71854824fb28edf49bbc244e079c9c4f78 (patch) | |
tree | 7ba8caccde57c938485038d48e9e4235080e6ece | |
parent | d134fda0c05640992941087139316d2b8fb3f816 (diff) | |
parent | ab178b8bac600562b9dadc529846a263efc14463 (diff) | |
download | dexon-solidity-6258fe71854824fb28edf49bbc244e079c9c4f78.tar dexon-solidity-6258fe71854824fb28edf49bbc244e079c9c4f78.tar.gz dexon-solidity-6258fe71854824fb28edf49bbc244e079c9c4f78.tar.bz2 dexon-solidity-6258fe71854824fb28edf49bbc244e079c9c4f78.tar.lz dexon-solidity-6258fe71854824fb28edf49bbc244e079c9c4f78.tar.xz dexon-solidity-6258fe71854824fb28edf49bbc244e079c9c4f78.tar.zst dexon-solidity-6258fe71854824fb28edf49bbc244e079c9c4f78.zip |
Merge pull request #1778 from ethereum/warnsendtransfer
Mention 'transfer' in warning about unchecked 'send'.
-rw-r--r-- | libsolidity/analysis/TypeChecker.cpp | 5 | ||||
-rw-r--r-- | 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) |