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