From db22e234465244b65ded22c160e75f93050d5f4d Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 21 Jul 2025 12:38:20 +0200 Subject: [PATCH] Avoid uninitialized variable btilde MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pre-initialize this variable. It should be set in pucch2x_scrambling(), but the compiler warns with In function ‘pucch2x_modulation’, inlined from ‘generate_pucch2x’ at oai/openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c:425:3: oai/openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c:361:18: warning: ‘btilde’ may be used uninitialized [-Wmaybe-uninitialized] 361 | d[i] = btilde[i] == 1 ? -amp : amp; oai/openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c: In function ‘generate_pucch2x’: oai/openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c:387:11: note: ‘btilde’ declared here 387 | uint8_t btilde[20]; --- openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c index 8db7549b36..d6361f4606 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c @@ -384,7 +384,7 @@ void generate_pucch2x(int32_t **txdataF, int i,j; uint32_t B=0; - uint8_t btilde[20]; + uint8_t btilde[20] = {0}; int16_t d[22]; uint8_t deltaPUCCH_Shift = fp->pucch_config_common.deltaPUCCH_Shift; uint8_t NRB2 = fp->pucch_config_common.nRB_CQI;