fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-pcu/+/34533?usp=email )
Change subject: bts: bts_tfi_find_free(): fix -Wmaybe-uninitialized (false positive) ......................................................................
bts: bts_tfi_find_free(): fix -Wmaybe-uninitialized (false positive)
We cannot see how uninitialized access is possible, but gcc v13.2.1 does complain about it. Let's work this around by assigning an invalid value, like trx_count_free_tfi() does.
Change-Id: Ia446cdf573ee25e6da6b4aa917972c63472229bb Fixes: OS#6190 --- M src/bts.cpp 1 file changed, 15 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/33/34533/1
diff --git a/src/bts.cpp b/src/bts.cpp index 0950f7a..50c21a3 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -642,7 +642,7 @@
/* find a TFI that is unused on all PDCH */ for (trx = trx_from; trx <= trx_to; trx++) { - uint8_t tmp_first_tfi; + uint8_t tmp_first_tfi = 0xff; /* make gcc happy */ unsigned int tmp_cnt; tmp_cnt = trx_count_free_tfi(&bts->trx[trx], dir, &tmp_first_tfi); if (tmp_cnt > best_cnt) {