From 93ef558fa8484211bd1d78c06bbd14aae1b2ece5 Mon Sep 17 00:00:00 2001 From: Rahul Kar <118818625+kar-rahul-aws@users.noreply.github.com> Date: Thu, 7 Dec 2023 14:56:44 +0530 Subject: [PATCH] Declare variable without initializer (#841) Co-authored-by: Soren Ptak Co-authored-by: chinglee-iot <61685396+chinglee-iot@users.noreply.github.com> Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com> --- tasks.c | 3 ++- timers.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tasks.c b/tasks.c index 5df19ddb0..7c05bd531 100644 --- a/tasks.c +++ b/tasks.c @@ -7412,7 +7412,8 @@ static void prvResetNextTaskUnblockTime( void ) int iSnprintfReturnValue; BaseType_t xOutputBufferFull = pdFALSE; UBaseType_t uxArraySize, x; - configRUN_TIME_COUNTER_TYPE ulTotalTime, ulStatsAsPercentage; + configRUN_TIME_COUNTER_TYPE ulTotalTime = 0; + configRUN_TIME_COUNTER_TYPE ulStatsAsPercentage; traceENTER_vTaskGetRunTimeStatistics( pcWriteBuffer, uxBufferLength ); diff --git a/timers.c b/timers.c index 2d24bf042..72636cf46 100644 --- a/timers.c +++ b/timers.c @@ -943,12 +943,12 @@ static void prvProcessReceivedCommands( void ) { - DaemonTaskMessage_t xMessage; + DaemonTaskMessage_t xMessage = { 0 }; Timer_t * pxTimer; BaseType_t xTimerListsWereSwitched; TickType_t xTimeNow; - while( xQueueReceive( xTimerQueue, &xMessage, tmrNO_DELAY ) != pdFAIL ) /*lint !e603 xMessage does not have to be initialised as it is passed out, not in, and it is not used unless xQueueReceive() returns pdTRUE. */ + while( xQueueReceive( xTimerQueue, &xMessage, tmrNO_DELAY ) != pdFAIL ) { #if ( INCLUDE_xTimerPendFunctionCall == 1 ) {