summaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-01-02 11:25:54 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-01-02 11:42:38 +0100
commitc6e32ad0b8b4e040b836bcd6bf88a8279612d94d (patch)
tree118552e5550f08af832176356b19094b4f70df76 /openbsc
parentc83f0276b3d0e58b3c2187923f481026952b113b (diff)
Partial revert "Fix most compiler warnings with gcc-4.9.2"
Most of the "fixes" have nothing to do with gcc-4.9.2 but are a question of ABI/Architecture (e.g. x86 vs. AMD64). Revert these for now. This partially reverts commit 7b1d25a11e44bbc1cb0d2acd9f1a3d4a16ec7c90. abis_test.c: In function ‘test_simple_sw_config’: abis_test.c:68:2: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘int’ [-Wformat=] printf("Start: %ld len: %zu\n", descr[0].start - simple_config, descr[0].len); ^ abis_test.c: In function ‘test_dual_sw_config’: abis_test.c:111:2: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘int’ [-Wformat=] printf("Start: %ld len: %zu\n", descr[0].start - dual_config, descr[0].len); ^ abis_test.c:115:2: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘int’ [-Wformat=] printf("Start: %ld len: %zu\n", descr[1].start - dual_config, descr[1].len); ^ abis_test.c: In function ‘test_sw_selection’: abis_test.c:132:2: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘int’ [-Wformat=] printf("Start: %ld len: %zu\n", descr[0].start - load_config, descr[0].len); ^ abis_test.c:136:2: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘int’ [-Wformat=] printf("Start: %ld len: %zu\n", descr[1].start - load_config, descr[1].len);
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/src/libmgcp/mgcp_protocol.c2
-rw-r--r--openbsc/tests/abis/abis_test.c16
-rw-r--r--openbsc/tests/gbproxy/gbproxy_test.c16
3 files changed, 17 insertions, 17 deletions
diff --git a/openbsc/src/libmgcp/mgcp_protocol.c b/openbsc/src/libmgcp/mgcp_protocol.c
index f22dd2012..ccd15e842 100644
--- a/openbsc/src/libmgcp/mgcp_protocol.c
+++ b/openbsc/src/libmgcp/mgcp_protocol.c
@@ -309,7 +309,7 @@ static int write_response_sdp(struct mgcp_endpoint *endp,
return len;
buffer_too_small:
- LOGP(DMGCP, LOGL_ERROR, "SDP buffer too small: %zd (needed %d)\n",
+ LOGP(DMGCP, LOGL_ERROR, "SDP buffer too small: %zu (needed %d)\n",
size, len);
return -1;
}
diff --git a/openbsc/tests/abis/abis_test.c b/openbsc/tests/abis/abis_test.c
index df270bfbd..e7e78d202 100644
--- a/openbsc/tests/abis/abis_test.c
+++ b/openbsc/tests/abis/abis_test.c
@@ -61,11 +61,11 @@ static void test_simple_sw_config(void)
}
if (descr[0].len != 13) {
- printf("WRONG SIZE: %zu\n", descr[0].len);
+ printf("WRONG SIZE: %d\n", descr[0].len);
abort();
}
- printf("Start: %ld len: %zu\n", descr[0].start - simple_config, descr[0].len);
+ printf("Start: %u len: %zu\n", descr[0].start - simple_config, descr[0].len);
printf("file_id: %s\n", osmo_hexdump(descr[0].file_id, descr[0].file_id_len));
printf("file_ver: %s\n", osmo_hexdump(descr[0].file_ver, descr[0].file_ver_len));
}
@@ -99,20 +99,20 @@ static void test_dual_sw_config(void)
}
if (descr[0].len != 13) {
- printf("WRONG SIZE0: %zu\n", descr[0].len);
+ printf("WRONG SIZE0: %d\n", descr[0].len);
abort();
}
if (descr[1].len != 13) {
- printf("WRONG SIZE1: %zu\n", descr[1].len);
+ printf("WRONG SIZE1: %d\n", descr[1].len);
abort();
}
- printf("Start: %ld len: %zu\n", descr[0].start - dual_config, descr[0].len);
+ printf("Start: %u len: %zu\n", descr[0].start - dual_config, descr[0].len);
printf("file_id: %s\n", osmo_hexdump(descr[0].file_id, descr[0].file_id_len));
printf("file_ver: %s\n", osmo_hexdump(descr[0].file_ver, descr[0].file_ver_len));
- printf("Start: %ld len: %zu\n", descr[1].start - dual_config, descr[1].len);
+ printf("Start: %u len: %zu\n", descr[1].start - dual_config, descr[1].len);
printf("file_id: %s\n", osmo_hexdump(descr[1].file_id, descr[1].file_id_len));
printf("file_ver: %s\n", osmo_hexdump(descr[1].file_ver, descr[1].file_ver_len));
}
@@ -129,11 +129,11 @@ static void test_sw_selection(void)
abort();
}
- printf("Start: %ld len: %zu\n", descr[0].start - load_config, descr[0].len);
+ printf("Start: %u len: %zu\n", descr[0].start - load_config, descr[0].len);
printf("file_id: %s\n", osmo_hexdump(descr[0].file_id, descr[0].file_id_len));
printf("file_ver: %s\n", osmo_hexdump(descr[0].file_ver, descr[0].file_ver_len));
- printf("Start: %ld len: %zu\n", descr[1].start - load_config, descr[1].len);
+ printf("Start: %u len: %zu\n", descr[1].start - load_config, descr[1].len);
printf("file_id: %s\n", osmo_hexdump(descr[1].file_id, descr[1].file_id_len));
printf("file_ver: %s\n", osmo_hexdump(descr[1].file_ver, descr[1].file_ver_len));
diff --git a/openbsc/tests/gbproxy/gbproxy_test.c b/openbsc/tests/gbproxy/gbproxy_test.c
index 0c18ab7b1..0fc8af202 100644
--- a/openbsc/tests/gbproxy/gbproxy_test.c
+++ b/openbsc/tests/gbproxy/gbproxy_test.c
@@ -956,7 +956,7 @@ int gprs_ns_rcvmsg(struct gprs_ns_inst *nsi, struct msgb *msg,
int gprs_ns_callback(enum gprs_ns_evt event, struct gprs_nsvc *nsvc,
struct msgb *msg, uint16_t bvci)
{
- printf("CALLBACK, event %d, msg length %ld, bvci 0x%04x\n%s\n\n",
+ printf("CALLBACK, event %d, msg length %d, bvci 0x%04x\n%s\n\n",
event, msgb_bssgp_len(msg), bvci,
osmo_hexdump(msgb_l2(msg), msgb_l2len(msg)));
@@ -983,15 +983,15 @@ ssize_t sendto(int sockfd, const void *buf, size_t len, int flags,
real_sendto = dlsym(RTLD_NEXT, "sendto");
if (dest_host == REMOTE_BSS_ADDR)
- printf("MESSAGE to BSS at 0x%08x:%d, msg length %zu\n%s\n\n",
+ printf("MESSAGE to BSS at 0x%08x:%d, msg length %d\n%s\n\n",
dest_host, dest_port,
len, osmo_hexdump(buf, len));
else if (dest_host == REMOTE_SGSN_ADDR)
- printf("MESSAGE to SGSN at 0x%08x:%d, msg length %zu\n%s\n\n",
+ printf("MESSAGE to SGSN at 0x%08x:%d, msg length %d\n%s\n\n",
dest_host, dest_port,
len, osmo_hexdump(buf, len));
else if (dest_host == REMOTE_SGSN2_ADDR)
- printf("MESSAGE to SGSN 2 at 0x%08x:%d, msg length %zu\n%s\n\n",
+ printf("MESSAGE to SGSN 2 at 0x%08x:%d, msg length %d\n%s\n\n",
dest_host, dest_port,
len, osmo_hexdump(buf, len));
else
@@ -1015,15 +1015,15 @@ int gprs_ns_sendmsg(struct gprs_ns_inst *nsi, struct msgb *msg)
if (nsei == SGSN_NSEI)
printf("NS UNITDATA MESSAGE to SGSN, BVCI 0x%04x, "
- "msg length %zu (%s)\n",
+ "msg length %d (%s)\n",
bvci, len, __func__);
else if (nsei == SGSN2_NSEI)
printf("NS UNITDATA MESSAGE to SGSN 2, BVCI 0x%04x, "
- "msg length %zu (%s)\n",
+ "msg length %d (%s)\n",
bvci, len, __func__);
else
printf("NS UNITDATA MESSAGE to BSS, BVCI 0x%04x, "
- "msg length %zu (%s)\n",
+ "msg length %d (%s)\n",
bvci, len, __func__);
if (received_messages) {
@@ -1253,7 +1253,7 @@ static int gprs_process_message(struct gprs_ns_inst *nsi, const char *text, stru
struct msgb *msg;
int ret;
if (data_len > NS_ALLOC_SIZE - NS_ALLOC_HEADROOM) {
- fprintf(stderr, "message too long: %zu\n", data_len);
+ fprintf(stderr, "message too long: %d\n", data_len);
return -1;
}