From beea7bac68db197b2a0b18b862f8e55f8ff5e4f7 Mon Sep 17 00:00:00 2001 From: Yakun Xu Date: Tue, 21 Nov 2023 07:22:14 +0800 Subject: [PATCH] [lint] explicitly initialize failedAddresses (#9622) Compiling with GCC 13.2.0, got the maybe-uninitialized error. This commit fixes it by initializing the array. --- src/core/thread/mlr_manager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/thread/mlr_manager.cpp b/src/core/thread/mlr_manager.cpp index 4fd5355f4..db7bc938f 100644 --- a/src/core/thread/mlr_manager.cpp +++ b/src/core/thread/mlr_manager.cpp @@ -351,7 +351,7 @@ void MlrManager::HandleRegisterMulticastListenersResponse(otMessage *a uint8_t status; Error error; - Ip6::Address failedAddresses[Ip6AddressesTlv::kMaxAddresses]; + Ip6::Address failedAddresses[Ip6AddressesTlv::kMaxAddresses]{}; uint8_t failedAddressNum = 0; Callback callbackCopy = mRegisterMulticastListenersCallback; @@ -447,7 +447,7 @@ void MlrManager::HandleMulticastListenerRegistrationResponse(Coap::Message uint8_t status; Error error; - Ip6::Address failedAddresses[Ip6AddressesTlv::kMaxAddresses]; + Ip6::Address failedAddresses[Ip6AddressesTlv::kMaxAddresses]{}; uint8_t failedAddressNum = 0; error = ParseMulticastListenerRegistrationResponse(aResult, aMessage, status, failedAddresses, failedAddressNum);