pespin has uploaded this change for review.

View Change

bts-trx: sched_lchan_tchh.c: Workaround gcc false positive error

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
---
M src/osmo-bts-trx/sched_lchan_tchh.c
1 file changed, 2 insertions(+), 1 deletion(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/51/27851/1
diff --git a/src/osmo-bts-trx/sched_lchan_tchh.c b/src/osmo-bts-trx/sched_lchan_tchh.c
index 1b4aa40..2281fb7 100644
--- a/src/osmo-bts-trx/sched_lchan_tchh.c
+++ b/src/osmo-bts-trx/sched_lchan_tchh.c
@@ -85,7 +85,8 @@
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;

To view, visit change 27851. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ifebaee63a9dad04976ffb4438c32360687ef095a
Gerrit-Change-Number: 27851
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin@sysmocom.de>
Gerrit-MessageType: newchange