boost::bind usage was removed in #13743. However a new usage snuck in as
part of 2bc4c3eaf96f5f8490fc79280422916c5d14cde3 (#15225).
remove usage of boost::bind #19844
pull fanquake wants to merge 2 commits into bitcoin:master from fanquake:sneak_boost_bind changing 2 files +22 −1-
fanquake commented at 11:46 AM on August 31, 2020: member
-
c4be50fea3
remove usage of boost::bind
boost::bind usage was removed in #13743. However a new usage snuck in as part of 2bc4c3eaf96f5f8490fc79280422916c5d14cde3 (#15225).
- hebasto approved
-
hebasto commented at 11:55 AM on August 31, 2020: member
ACK c4be50fea31e85f0e7151ed5ecaba531f6f929db, it seems a linter is required :)
- DrahtBot added the label GUI on Aug 31, 2020
-
practicalswift commented at 12:37 PM on August 31, 2020: contributor
ACK c4be50fea31e85f0e7151ed5ecaba531f6f929db -- diff looks correct @hebasto
ACK c4be50f, it seems a linter required :)
Linter requested. Linter delivered:
new file mode 100755 index 000000000..99d60b58d --- /dev/null +++ b/test/lint/lint-cpp.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +# +# Copyright (c) 2018-2020 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. +# +# Check for various C++ code patterns we want to avoid. + +export LC_ALL=C + +EXIT_CODE=0 + +OUTPUT=$(git grep -E "boost::bind\(" -- "*.cpp" "*.h") +if [[ ${OUTPUT} != "" ]]; then + echo "Use of boost::bind detected. Use std::bind instead." + echo + echo "${OUTPUT}" + EXIT_CODE=1 +fi + +exit ${EXIT_CODE}Always happy to lint!
-
laanwj commented at 1:48 PM on August 31, 2020: member
ACK Thanks @practicalswift — I think we do need a linter here, my first idea was to forbid the header that introduces
boost::bindinstead, however it seems it's included indirectly through almost anything boost … - MarcoFalke added the label Refactoring on Aug 31, 2020
-
promag commented at 2:42 PM on August 31, 2020: member
ACK + linter.
-
e36f802fa4
lint: add C++ code linter
This currently only checks for boost::bind usage. Co-authored-by: practicalswift <practicalswift@users.noreply.github.com>
-
fanquake commented at 6:30 AM on September 1, 2020: member
C++ linter added as requested.
-
in test/lint/lint-cpp.sh:21 in e36f802fa4
16 | + echo 17 | + echo "${OUTPUT}" 18 | + EXIT_CODE=1 19 | +fi 20 | + 21 | +exit ${EXIT_CODE}
hebasto commented at 7:45 AM on September 1, 2020:nanonit:
practicalswift commented at 7:46 AM on September 1, 2020: contributorACK e36f802fa4916586b53a989c0848389ad838b846 -- patch looks correct
hebasto approvedhebasto commented at 7:46 AM on September 1, 2020: memberACK e36f802fa4916586b53a989c0848389ad838b846
Result of cherry-picking only the linter commit into the master branch:
$ test/lint/lint-cpp.sh Use of boost::bind detected. Use std::bind instead. src/qt/walletmodel.cpp: m_handler_can_get_addrs_changed = m_wallet->handleCanGetAddressesChanged(boost::bind(NotifyCanGetAddressesChanged, this));fanquake merged this on Sep 3, 2020fanquake closed this on Sep 3, 2020fanquake deleted the branch on Sep 3, 2020PastaPastaPasta referenced this in commit b10159648f on Aug 21, 2021DrahtBot locked this on Feb 15, 2022
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 21:14 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 21:14 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me