fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/37213?usp=email )


Change subject: mobile: fix -Wmaybe-uninitialized in gsm48_rr_tx_meas_rep()
......................................................................

mobile: fix -Wmaybe-uninitialized in gsm48_rr_tx_meas_rep()

This is very unlikely to happen, because we set strongest to 127,
but anyway we don't want to see those warnings:

gsm48_rr.c: In function ‘gsm48_rr_tx_meas_rep.isra’:
gsm48_rr.c:3714:74: warning: ‘strongest_i’ may be used uninitialized 
[-Wmaybe-uninitialized]
 3714 |                                 if (rrmeas->nc_rxlev_dbm[i] == 
strongest && i <= strongest_i)
      |                                     
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
gsm48_rr.c:3696:31: note: ‘strongest_i’ was declared here
 3696 |                 int i, index, strongest_i;
      |                               ^~~~~~~~~~~

Change-Id: I111438633ed48e16f7c43fc1b7a23ae6753a404d
---
M src/host/layer23/src/mobile/gsm48_rr.c
1 file changed, 21 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/13/37213/1

diff --git a/src/host/layer23/src/mobile/gsm48_rr.c 
b/src/host/layer23/src/mobile/gsm48_rr.c
index 83287c1..1750c57 100644
--- a/src/host/layer23/src/mobile/gsm48_rr.c
+++ b/src/host/layer23/src/mobile/gsm48_rr.c
@@ -3703,6 +3703,7 @@

                /* get 6 strongest measurements */
                strongest = 127; /* infinite */
+               strongest_i = -1; /* make gcc happy */
                for (n = 0; n < 6; n++) {
                        current = -128; /* -infinite */
                        index = 0;

--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/37213?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I111438633ed48e16f7c43fc1b7a23ae6753a404d
Gerrit-Change-Number: 37213
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <[email protected]>
Gerrit-MessageType: newchange

Reply via email to