Skip to content

Commit 3443630

Browse files
authored
ci: adds flag -Werror=reorder for arm target (#5540)
## Issue being fixed or feature implemented The order of members in a class/struct definition and the order of their initialization should match. This ensures that the code is more error-proof in cases where the order of member initializations is important, as they may depend on each other. Instead manual checking of member initialization better let CI handle it. Last PR where it's noticed: #5531 (comment) ## What was done? New flag "-Werror=reorder" for `configure.ac` and fixes existing code. ## How Has This Been Tested? Build code with `--enable-werror` ## Breaking Changes N/A ## Checklist: - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone
1 parent c37cbf3 commit 3443630

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

configure.ac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,7 @@ if test "x$enable_werror" = "xyes"; then
437437
if test "x$CXXFLAG_WERROR" = "x"; then
438438
AC_MSG_ERROR("enable-werror set but -Werror is not usable")
439439
fi
440+
AX_CHECK_COMPILE_FLAG([-Werror=reorder],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=reorder"],,[[$CXXFLAG_WERROR]])
440441
AX_CHECK_COMPILE_FLAG([-Werror=vla],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=vla"],,[[$CXXFLAG_WERROR]])
441442
AX_CHECK_COMPILE_FLAG([-Werror=shadow-field],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=shadow-field"],,[[$CXXFLAG_WERROR]])
442443
AX_CHECK_COMPILE_FLAG([-Werror=switch],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=switch"],,[[$CXXFLAG_WERROR]])

src/evo/simplifiedmns.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ CSimplifiedMNListEntry::CSimplifiedMNListEntry(const CDeterministicMN& dmn) :
3434
pubKeyOperator(dmn.pdmnState->pubKeyOperator),
3535
keyIDVoting(dmn.pdmnState->keyIDVoting),
3636
isValid(!dmn.pdmnState->IsBanned()),
37+
platformHTTPPort(dmn.pdmnState->platformHTTPPort),
38+
platformNodeID(dmn.pdmnState->platformNodeID),
3739
scriptPayout(dmn.pdmnState->scriptPayout),
3840
scriptOperatorPayout(dmn.pdmnState->scriptOperatorPayout),
3941
nVersion(dmn.pdmnState->nVersion == CProRegTx::LEGACY_BLS_VERSION ? LEGACY_BLS_VERSION : BASIC_BLS_VERSION),
40-
nType(dmn.nType),
41-
platformHTTPPort(dmn.pdmnState->platformHTTPPort),
42-
platformNodeID(dmn.pdmnState->platformNodeID)
42+
nType(dmn.nType)
4343
{
4444
}
4545

src/evo/simplifiedmns.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ class CSimplifiedMNListEntry
3434
CBLSLazyPublicKey pubKeyOperator;
3535
CKeyID keyIDVoting;
3636
bool isValid{false};
37-
MnType nType{MnType::Regular};
3837
uint16_t platformHTTPPort{0};
3938
uint160 platformNodeID{};
4039
CScript scriptPayout; // mem-only
4140
CScript scriptOperatorPayout; // mem-only
4241
uint16_t nVersion{LEGACY_BLS_VERSION};
42+
MnType nType{MnType::Regular};
4343

4444
CSimplifiedMNListEntry() = default;
4545
explicit CSimplifiedMNListEntry(const CDeterministicMN& dmn);

src/net_processing.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,9 +303,9 @@ class PeerManagerImpl final : public PeerManager
303303

304304
const CChainParams& m_chainparams;
305305
CConnman& m_connman;
306+
CAddrMan& m_addrman;
306307
/** Pointer to this node's banman. May be nullptr - check existence before dereferencing. */
307308
BanMan* const m_banman;
308-
CAddrMan& m_addrman;
309309
ChainstateManager& m_chainman;
310310
CTxMemPool& m_mempool;
311311
const std::unique_ptr<LLMQContext>& m_llmq_ctx;

src/qt/walletmodel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ WalletModel::WalletModel(std::unique_ptr<interfaces::Wallet> wallet, ClientModel
4646
transactionTableModel(nullptr),
4747
recentRequestsTableModel(nullptr),
4848
cachedEncryptionStatus(Unencrypted),
49+
timer(new QTimer(this)),
4950
cachedNumISLocks(0),
50-
cachedCoinJoinRounds(0),
51-
timer(new QTimer(this))
51+
cachedCoinJoinRounds(0)
5252
{
5353
fHaveWatchOnly = m_wallet->haveWatchOnly();
5454
addressTableModel = new AddressTableModel(this);

0 commit comments

Comments
 (0)