From 0f3d7ea35bff41b3452b60e3ee2516793954fa74 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Wed, 20 Apr 2022 16:09:29 +0200 Subject: [PATCH] bts-trx: sched_lchan_tchh.c: Workaround gcc false positive error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Manual analysis of code didn't end up in finding any issue, so this seems a false positive (I can really understand gcc failing to do proper job here, this function has way to many jumps here and there. """ /sched_lchan_tchh.c:88:13: error: ‘rc’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 88 | int rc, amr = 0; | ^~ """ Change-Id: Ifebaee63a9dad04976ffb4438c32360687ef095a --- src/osmo-bts-trx/sched_lchan_tchh.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/osmo-bts-trx/sched_lchan_tchh.c b/src/osmo-bts-trx/sched_lchan_tchh.c index 1b4aa40b3..2281fb756 100644 --- a/src/osmo-bts-trx/sched_lchan_tchh.c +++ b/src/osmo-bts-trx/sched_lchan_tchh.c @@ -85,7 +85,8 @@ int rx_tchh_fn(struct l1sched_ts *l1ts, const struct trx_ul_burst_ind *bi) uint8_t rsl_cmode = chan_state->rsl_cmode; uint8_t tch_mode = chan_state->tch_mode; uint8_t tch_data[128]; /* just to be safe */ - int rc, amr = 0; + int rc = 0; /* initialize to make gcc happy */ + int amr = 0; int n_errors = 0; int n_bits_total = 0; bool bfi_flag = false;