Skip to content

Commit

Permalink
Change declaration order to address GCC 12.1 error (#18385)
Browse files Browse the repository at this point in the history
GCC 12.1 complains:

```
../../src/messaging/ExchangeMgr.cpp: In constructor ‘chip::Messaging::ExchangeManager::ExchangeManager()’:
../../src/messaging/ExchangeMgr.cpp:62:58: error: member ‘chip::Messaging::ExchangeManager::mContextPool’ is used uninitialized [-Werror=uninitialized]
   62 | ExchangeManager::ExchangeManager() : mReliableMessageMgr(mContextPool)
      |                                                          ^~~~~~~~~~~~
At global scope:
cc1plus: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
cc1plus: all warnings being treated as errors
```

Make sure mContextPool comes before mReliableMessageMgr in the
declaration order.
  • Loading branch information
agners authored and pull[bot] committed Oct 26, 2023
1 parent b2fab9e commit 4728354
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/messaging/ExchangeMgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,13 @@ class DLL_EXPORT ExchangeManager : public SessionMessageDelegate
uint16_t mNextKeyId;
State mState;

SessionManager * mSessionManager;
ReliableMessageMgr mReliableMessageMgr;

FabricIndex mFabricIndex = 0;

BitMapObjectPool<ExchangeContext, CHIP_CONFIG_MAX_EXCHANGE_CONTEXTS> mContextPool;

SessionManager * mSessionManager;
ReliableMessageMgr mReliableMessageMgr;

UnsolicitedMessageHandlerSlot UMHandlerPool[CHIP_CONFIG_MAX_UNSOLICITED_MESSAGE_HANDLERS];

CHIP_ERROR RegisterUMH(Protocols::Id protocolId, int16_t msgType, UnsolicitedMessageHandler * handler);
Expand Down

0 comments on commit 4728354

Please sign in to comment.