[PATCH] libosmocore[master]: fix various compiler warnings (on FreeBSD-11.0)

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
Wed Feb 8 15:52:45 UTC 2017


Review at  https://gerrit.osmocom.org/1769

fix various compiler warnings (on FreeBSD-11.0)

FreeBSD 11.0 uses clang version 3.8.0 which spits various warnings
during libosmocore compilation.  Let's clean this up a bit.

Change-Id: Ic14572e6970bd0b8916604fabf807f1608fa07e5
---
M src/ctrl/control_if.c
M src/gsm/abis_nm.c
M src/gsm/ipa.c
M utils/osmo-sim-test.c
4 files changed, 6 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/69/1769/1

diff --git a/src/ctrl/control_if.c b/src/ctrl/control_if.c
index df39486..b4afd55 100644
--- a/src/ctrl/control_if.c
+++ b/src/ctrl/control_if.c
@@ -131,7 +131,7 @@
 		return -ENOMEM;
 
 	cmd->id = "0"; /* It's a TRAP! */
-	cmd->variable = name;
+	cmd->variable = (char *) name;
 	cmd->reply = value;
 	r = ctrl_cmd_send_to_all(ctrl, cmd);
 	talloc_free(cmd);
diff --git a/src/gsm/abis_nm.c b/src/gsm/abis_nm.c
index 10aae9a..155084a 100644
--- a/src/gsm/abis_nm.c
+++ b/src/gsm/abis_nm.c
@@ -571,7 +571,7 @@
 		return NULL;
 	}
 	if (len)
-		msgb_tl16v_put(nmsg, NM_ATT_ADD_TEXT, len, add_text);
+		msgb_tl16v_put(nmsg, NM_ATT_ADD_TEXT, len, (const uint8_t *) add_text);
 
 	return nmsg;
 }
diff --git a/src/gsm/ipa.c b/src/gsm/ipa.c
index 6dc3ab6..f44c328 100644
--- a/src/gsm/ipa.c
+++ b/src/gsm/ipa.c
@@ -28,6 +28,7 @@
 
 #include <arpa/inet.h>
 #include <sys/types.h>
+#include <sys/socket.h>
 
 #include <osmocom/core/msgb.h>
 #include <osmocom/core/talloc.h>
diff --git a/utils/osmo-sim-test.c b/utils/osmo-sim-test.c
index 7b79c58..d822bec 100644
--- a/utils/osmo-sim-test.c
+++ b/utils/osmo-sim-test.c
@@ -37,7 +37,7 @@
 			const uint8_t *data, uint8_t data_len)
 {
 	struct msgb *msg, *resp;
-	char *dst;
+	uint8_t *dst;
 
 	msg = osim_new_apdumsg(0x00, 0xA4, p1, p2, data_len, 256);
 	dst = msgb_put(msg, data_len);
@@ -65,7 +65,7 @@
 }
 
 /* 11.1.9 */
-static int verify_pin(struct osim_chan_hdl *st, uint8_t pin_nr, uint8_t *pin)
+static int verify_pin(struct osim_chan_hdl *st, uint8_t pin_nr, char *pin)
 {
 	struct msgb *msg;
 	char *pindst;
@@ -75,7 +75,7 @@
 		return -EINVAL;
 
 	msg = osim_new_apdumsg(0x00, 0x20, 0x00, pin_nr, 8, 0);
-	pindst = msgb_put(msg, 8);
+	pindst = (char *) msgb_put(msg, 8);
 	memset(pindst, 0xFF, 8);
 	strncpy(pindst, pin, strlen(pin));
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic14572e6970bd0b8916604fabf807f1608fa07e5
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>



More information about the gerrit-log mailing list