laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/27041 )
Change subject: xua_asp_fsm: Fix gcc false positive warning
......................................................................
xua_asp_fsm: Fix gcc false positive warning
As of GCC 11.1.0, it starts printing a warning about uninitialized
variable. It is a false positive since tmode is really only used in the
case where traffic_mode is not zero, in which case tmode is set.
Let's restrict the scope of tmode to fix the issue and also make it
clearer where the variable is used.
"""
In file included from /git/libosmo-sccp/src/xua_asp_fsm.c:25:
/git/libosmo-sccp/src/xua_asp_fsm.c: In function ‘xua_asp_fsm_inactive’:
/git/libosmo-sccp/include/osmocom/sigtran/osmo_ss7.h:274:16: error: ‘tmode’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
274 | return get_value_string(osmo_ss7_as_traffic_mode_vals, mode);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/git/libosmo-sccp/src/xua_asp_fsm.c:476:39: note: ‘tmode’ was declared here
476 | enum osmo_ss7_as_traffic_mode tmode;
|
"""
Change-Id: I4fc38724aba3a3f178ba0b45444e1394db44d039
---
M src/xua_asp_fsm.c
1 file changed, 1 insertion(+), 2 deletions(-)
Approvals:
laforge: Looks good to me, approved
fixeria: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/src/xua_asp_fsm.c b/src/xua_asp_fsm.c
index 5fe1d80..a93dbd2 100644
--- a/src/xua_asp_fsm.c
+++ b/src/xua_asp_fsm.c
@@ -473,7 +473,6 @@
struct osmo_ss7_as *as;
struct xua_msg *xua_in;
uint32_t traf_mode = 0;
- enum osmo_ss7_as_traffic_mode tmode;
struct xua_msg_part *part;
int i;
@@ -515,7 +514,6 @@
peer_send_error(fi, M3UA_ERR_UNSUPP_TRAF_MOD_TYP);
return;
}
- tmode = osmo_ss7_tmode_from_xua(traf_mode);
}
if ((part = xua_msg_find_tag(xua_in, M3UA_IEI_ROUTE_CTX))) {
for (i = 0; i < part->len / sizeof(uint32_t); i++) {
@@ -529,6 +527,7 @@
}
if (traf_mode) { /* if the peer has specified a traffic mode at all */
+ enum osmo_ss7_as_traffic_mode tmode = osmo_ss7_tmode_from_xua(traf_mode);
llist_for_each_entry(as, &asp->inst->as_list, list) {
if (!osmo_ss7_as_has_asp(as, asp))
continue;
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/27041
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I4fc38724aba3a3f178ba0b45444e1394db44d039
Gerrit-Change-Number: 27041
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: merged
Attention is currently required from: fixeria.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27042 )
Change subject: PGW_Tests: f_start_prog_wait(): print more debugging info
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27042
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I73314ccfdabd3860e15c732260b024f4c984bebf
Gerrit-Change-Number: 27042
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 01 Feb 2022 16:59:12 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment