[MERGED] osmo-sgsn[master]: compiler warnings: use enum ranap_nsap_addr_enc, constify lo...

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Fri Mar 16 09:16:21 UTC 2018


Harald Welte has submitted this change and it was merged.

Change subject: compiler warnings: use enum ranap_nsap_addr_enc, constify local var
......................................................................


compiler warnings: use enum ranap_nsap_addr_enc, constify local var

Use the proper enum ranap_nsap_addr_enc instead of int, and properly exclude
that member when we're building without Iu support:

sgsn_vty.c:1323:31: error: passing argument 2 of ‘ranap_iu_vty_init’ from incompatible pointer type [-Werror=incompatible-pointer-types]
  ranap_iu_vty_init(SGSN_NODE, &g_cfg->iu.rab_assign_addr_enc);

Add const to a local var to silence compiler warning retrieving TLVP_VAL:

gprs_gmm.c:1657:18: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
    uint8_t *mi = TLVP_VAL(&tp, GSM48_IE_GMM_ALLOC_PTMSI);
                  ^~~~~~~~

Change-Id: I1168ce6425c31db3f6c3bf1f3682ae96b028c59b
---
M include/osmocom/sgsn/sgsn.h
M src/gprs/gprs_gmm.c
2 files changed, 10 insertions(+), 2 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmocom/sgsn/sgsn.h b/include/osmocom/sgsn/sgsn.h
index 7e0b5d4..829a8fc 100644
--- a/include/osmocom/sgsn/sgsn.h
+++ b/include/osmocom/sgsn/sgsn.h
@@ -9,6 +9,12 @@
 #include <osmocom/sgsn/oap_client.h>
 #include <osmocom/sgsn/common.h>
 
+#include "../../bscconfig.h"
+
+#if BUILD_IU
+#include <osmocom/ranap/iu_client.h>
+#endif
+
 #include <ares.h>
 #include <gtp.h>
 
@@ -113,9 +119,11 @@
 		int p2;
 	} dcomp_v42bis;
 
+#if BUILD_IU
 	struct {
-		int rab_assign_addr_enc;
+		enum ranap_nsap_addr_enc rab_assign_addr_enc;
 	} iu;
+#endif
 };
 
 struct sgsn_instance {
diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c
index c9fb8da..ff993cc 100644
--- a/src/gprs/gprs_gmm.c
+++ b/src/gprs/gprs_gmm.c
@@ -1654,7 +1654,7 @@
 			/* In Iu mode search only for ptmsi */
 			char mi_string[GSM48_MI_SIZE];
 			uint8_t mi_len = TLVP_LEN(&tp, GSM48_IE_GMM_ALLOC_PTMSI);
-			uint8_t *mi = TLVP_VAL(&tp, GSM48_IE_GMM_ALLOC_PTMSI);
+			const uint8_t *mi = TLVP_VAL(&tp, GSM48_IE_GMM_ALLOC_PTMSI);
 			uint8_t mi_type = *mi & GSM_MI_TYPE_MASK;
 			uint32_t tmsi;
 

-- 
To view, visit https://gerrit.osmocom.org/7297
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1168ce6425c31db3f6c3bf1f3682ae96b028c59b
Gerrit-PatchSet: 2
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list