diff options
author | Vadim Yanitskiy <vyanitskiy@sysmocom.de> | 2023-09-26 20:36:51 +0700 |
---|---|---|
committer | Vadim Yanitskiy <vyanitskiy@sysmocom.de> | 2023-09-26 20:43:53 +0700 |
commit | 30a7d26c83be79ac6d592bf3b6a96575f15362ba (patch) | |
tree | c639bf5e9e8c97510c8285a458b53bd6dda8223b /src | |
parent | a155fe85de9151d26fdfad7a6593a95592ac9770 (diff) |
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.
src/bts.cpp: In function 'int bts_tfi_find_free(const gprs_rlcmac_bts*,
gprs_rlcmac_tbf_direction,
uint8_t*, int8_t)':
warning: 'tmp_first_tfi' may be used uninitialized [-Wmaybe-uninitialized]
Change-Id: Ia446cdf573ee25e6da6b4aa917972c63472229bb
Fixes: OS#6190
Diffstat (limited to 'src')
-rw-r--r-- | src/bts.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bts.cpp b/src/bts.cpp index 0950f7a7..50c21a3e 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -642,7 +642,7 @@ int bts_tfi_find_free(const struct gprs_rlcmac_bts *bts, enum gprs_rlcmac_tbf_di /* 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) { |