Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: adds flag -Werror=reorder for arm target #5540

Merged
merged 2 commits into from
Aug 22, 2023
Merged

Conversation

knst
Copy link
Collaborator

@knst knst commented Aug 20, 2023

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:

  • 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
  • I have assigned this pull request to a milestone

knst added 2 commits August 21, 2023 00:56
…ir order

It fixes this warning:
net_processing.cpp: In constructor ‘{anonymous}::PeerManagerImpl::PeerManagerImpl(const CChainParams&, CConnman&, CAddrMan&, BanMan*, CScheduler&, ChainstateManager&, CTxMemPool&, const std::unique_ptr<LLMQContext>&, bool)’:
net_processing.cpp:308:15: error: ‘{anonymous}::PeerManagerImpl::m_addrman’ will be initialized after [-Werror=reorder]
  308 |     CAddrMan& m_addrman;
      |               ^~~~~~~~~
net_processing.cpp:307:19: error:   ‘BanMan* const {anonymous}::PeerManagerImpl::m_banman’ [-Werror=reorder]
  307 |     BanMan* const m_banman;
      |                   ^~~~~~~~
net_processing.cpp:1547:1: error:   when initialized here [-Werror=reorder]
 1547 | PeerManagerImpl::PeerManagerImpl(const CChainParams& chainparams, CConnman& connman, CAddrMan& addrman, BanMan* banman,
      | ^~~~~~~~~~~~~~~
Copy link
Collaborator

@kwvg kwvg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK

Copy link
Member

@PastaPastaPasta PastaPastaPasta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK for squash merge

Copy link
Collaborator

@ogabrielides ogabrielides left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@UdjinM6 UdjinM6 merged commit 3443630 into dashpay:develop Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants