pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-gprs/+/32608 )
Change subject: gmm: Fix false positive compilation error with gcc 13.1.1 ......................................................................
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(-)
Approvals: Jenkins Builder: Verified daniel: Looks good to me, but someone else must approve fixeria: Looks good to me, approved
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);