diff --git a/src/bench/crypto_hash.cpp b/src/bench/crypto_hash.cpp --- a/src/bench/crypto_hash.cpp +++ b/src/bench/crypto_hash.cpp @@ -66,7 +66,7 @@ static void FastRandom_32bit(benchmark::State &state) { FastRandomContext rng(true); - uint32_t x; + uint32_t x = 0; while (state.KeepRunning()) { for (int i = 0; i < 1000000; i++) { x += rng.rand32(); @@ -76,7 +76,7 @@ static void FastRandom_1bit(benchmark::State &state) { FastRandomContext rng(true); - uint32_t x; + uint32_t x = 0; while (state.KeepRunning()) { for (int i = 0; i < 1000000; i++) { x += rng.randbool(); diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp --- a/src/qt/paymentserver.cpp +++ b/src/qt/paymentserver.cpp @@ -239,9 +239,9 @@ // message()", but "QMessageBox::"! // void PaymentServer::ipcParseCommandLine(int argc, char *argv[]) { - std::array networks = {&CBaseChainParams::MAIN, - &CBaseChainParams::TESTNET, - &CBaseChainParams::REGTEST}; + std::array networks = { + {&CBaseChainParams::MAIN, &CBaseChainParams::TESTNET, + &CBaseChainParams::REGTEST}}; const std::string *chosenNetwork = nullptr; diff --git a/src/seeder/bitcoin.cpp b/src/seeder/bitcoin.cpp --- a/src/seeder/bitcoin.cpp +++ b/src/seeder/bitcoin.cpp @@ -13,7 +13,7 @@ bool fTestNet; // The network magic to use. -CMessageHeader::MessageMagic netMagic = {0xe3, 0xe1, 0xf3, 0xe8}; +CMessageHeader::MessageMagic netMagic = {{0xe3, 0xe1, 0xf3, 0xe8}}; #define BITCOIN_SEED_NONCE 0x0539a019ca550825ULL diff --git a/src/test/amount_tests.cpp b/src/test/amount_tests.cpp --- a/src/test/amount_tests.cpp +++ b/src/test/amount_tests.cpp @@ -84,7 +84,7 @@ } BOOST_AUTO_TEST_CASE(AmountTests) { - std::array values = {-23, -1, 0, 1, 2, 3, 42, 99999999}; + std::array values = {{-23, -1, 0, 1, 2, 3, 42, 99999999}}; for (int64_t i : values) { for (int64_t j : values) { diff --git a/src/test/monolith_opcodes.cpp b/src/test/monolith_opcodes.cpp --- a/src/test/monolith_opcodes.cpp +++ b/src/test/monolith_opcodes.cpp @@ -14,8 +14,8 @@ typedef std::vector valtype; typedef std::vector stacktype; -std::array flagset{0, STANDARD_SCRIPT_VERIFY_FLAGS, - MANDATORY_SCRIPT_VERIFY_FLAGS}; +std::array flagset{ + {0, STANDARD_SCRIPT_VERIFY_FLAGS, MANDATORY_SCRIPT_VERIFY_FLAGS}}; BOOST_FIXTURE_TEST_SUITE(monolith_opcodes_tests, BasicTestingSetup) diff --git a/src/test/test_bitcoin_fuzzy.cpp b/src/test/test_bitcoin_fuzzy.cpp --- a/src/test/test_bitcoin_fuzzy.cpp +++ b/src/test/test_bitcoin_fuzzy.cpp @@ -192,8 +192,8 @@ break; } case CMESSAGEHEADER_DESERIALIZE: { - CMessageHeader::MessageMagic pchMessageStart = {0x00, 0x00, 0x00, - 0x00}; + CMessageHeader::MessageMagic pchMessageStart = { + {0x00, 0x00, 0x00, 0x00}}; try { CMessageHeader mh(pchMessageStart); ds >> mh; diff --git a/src/txdb.cpp b/src/txdb.cpp --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -49,7 +49,7 @@ s >> key; uint256 id; s >> id; - uint32_t n; + uint32_t n = 0; s >> VARINT(n); *outpoint = COutPoint(id, n); }