pespin has uploaded this change for review.

View Change

gmm: Fix false positive compilation error with gcc 13.1.1

Newer gcc errors about "cause" being uninitialized, but cause is
guaranteed to be set in the "case GPRS_GMM_MS_EV_LOW_LVL_FAIL" path, it
just fails to find out.

Since the approach used previously is a bit hacky, let's simplify it.

Change-Id: I1c96b0aa92d4f9205a1d4d1760c787fe0e0ed169
---
M src/gmm/gmm_ms_fsm.c
1 file changed, 16 insertions(+), 4 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/libosmo-gprs refs/changes/08/32608/1
diff --git a/src/gmm/gmm_ms_fsm.c b/src/gmm/gmm_ms_fsm.c
index 6f82815..f553ad3 100644
--- a/src/gmm/gmm_ms_fsm.c
+++ b/src/gmm/gmm_ms_fsm.c
@@ -102,7 +102,7 @@
static void st_gmm_ms_registered_initiated(struct osmo_fsm_inst *fi, uint32_t event, void *data)
{
struct gprs_gmm_ms_fsm_ctx *ctx = (struct gprs_gmm_ms_fsm_ctx *)fi->priv;
- uint8_t cause;
+ uint8_t cause = GMM_CAUSE_MAC_FAIL;
int rc;
struct gprs_gmm_ms_fsm_attach_ctx att;

@@ -120,9 +120,6 @@
memcpy(&att, &ctx->attach, sizeof(att));
gmm_ms_fsm_state_chg(fi, GPRS_GMM_MS_ST_DEREGISTERED);

- if (event == GPRS_GMM_MS_EV_LOW_LVL_FAIL)
- cause = GMM_CAUSE_MAC_FAIL;
-
if (att.explicit_att) {
/* Submit GMMREG-ATTACH-REJ as per TS 24.007 Annex C.1 */
rc = gprs_gmm_submit_gmmreg_attach_cnf(ctx->gmme, false, cause);

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

Gerrit-Project: libosmo-gprs
Gerrit-Branch: master
Gerrit-Change-Id: I1c96b0aa92d4f9205a1d4d1760c787fe0e0ed169
Gerrit-Change-Number: 32608
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin@sysmocom.de>
Gerrit-MessageType: newchange