Attempting to build from the current master branch (commit 111849345bb5140f86b48e730ceab4bff45fa2e9) with gcc version 4.9.2 (Debian 4.9.2-10)
I see a lot of warning messages:
CXX bitcoind-bitcoind.o
In file included from util.h:18:0,
from bitcoind.cpp:17:
tinyformat.h: In constructor ‘tinyformat::format_error::format_error(const string&)’:
tinyformat.h:170:42: warning: declaration of ‘what’ shadows a member of 'this' [-Wshadow]
format_error(const std::string &what): std::runtime_error(what) {
^
CXX libbitcoin_server_a-addrman.o
In file included from util.h:18:0,
from addrman.h:14,
from addrman.cpp:6:
tinyformat.h: In constructor ‘tinyformat::format_error::format_error(const string&)’:
tinyformat.h:170:42: warning: declaration of ‘what’ shadows a member of 'this' [-Wshadow]
format_error(const std::string &what): std::runtime_error(what) {
^
CXX libbitcoin_server_a-addrdb.o
In file included from util.h:18:0,
from addrman.h:14,
from addrdb.cpp:8:
tinyformat.h: In constructor ‘tinyformat::format_error::format_error(const string&)’:
tinyformat.h:170:42: warning: declaration of ‘what’ shadows a member of 'this' [-Wshadow]
format_error(const std::string &what): std::runtime_error(what) {
^
This appears to have been recently introduced by https://github.com/bitcoin/bitcoin/commit/b651270c. A fix would seem to be something like this:
diff --git a/src/tinyformat.h b/src/tinyformat.h
index 5022d46..df128f1 100644
--- a/src/tinyformat.h
+++ b/src/tinyformat.h
@@ -167,7 +167,7 @@ namespace tinyformat {
class format_error: public std::runtime_error
{
public:
- format_error(const std::string &what): std::runtime_error(what) {
+ format_error(const std::string &_what): std::runtime_error(_what) {
}
};