Skip to content

Commit 4728354

Browse files
agnerspull[bot]
authored andcommitted
Change declaration order to address GCC 12.1 error (#18385)
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.
1 parent b2fab9e commit 4728354

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/messaging/ExchangeMgr.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -226,13 +226,13 @@ class DLL_EXPORT ExchangeManager : public SessionMessageDelegate
226226
uint16_t mNextKeyId;
227227
State mState;
228228

229-
SessionManager * mSessionManager;
230-
ReliableMessageMgr mReliableMessageMgr;
231-
232229
FabricIndex mFabricIndex = 0;
233230

234231
BitMapObjectPool<ExchangeContext, CHIP_CONFIG_MAX_EXCHANGE_CONTEXTS> mContextPool;
235232

233+
SessionManager * mSessionManager;
234+
ReliableMessageMgr mReliableMessageMgr;
235+
236236
UnsolicitedMessageHandlerSlot UMHandlerPool[CHIP_CONFIG_MAX_UNSOLICITED_MESSAGE_HANDLERS];
237237

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

0 commit comments

Comments
 (0)