summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2017-12-03 12:57:07 +0000
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2017-12-03 12:58:52 +0000
commit229ea1ca5bce63cb52194dec1a932ba351f7aa64 (patch)
treedcb243fbc87b0ded8da38d809833d49dd21c46d1
parent271cdad401de897fed49c19897bf89359044457e (diff)
mobile: Fix compiler warning on printing ptrdiff_t
The "msg->tail - msg->l4h" subtract two unsigned char* pointers and should result in a ptrdiff_t. Fix the compiler warning by using "%ti" in the printf. Fixes: gsm411_sms.c: In function ‘gsm411_rx_rp_ud’: gsm411_sms.c:382:25: warning: format ‘%li’ expects argument of type ‘long int’, but argument 7 has type ‘int’ [-Wformat=] LOGP(DLSMS, LOGL_INFO, "TPDU(%li,%s)\n", msg->tail-msg->l4h, ^ /home/ich/install/openbsc/include/osmocom/core/logging.h:93:54: note: in definition of macro ‘LOGPSRCC’ logp2(ss, level, caller_file, caller_line, cont, fmt, ##args); \ ^~~ /home/ich/install/openbsc/include/osmocom/core/logging.h:47:2: note: in expansion of macro ‘LOGPSRC’ LOGPSRC(ss, level, NULL, 0, fmt, ## args) ^~~~~~~ gsm411_sms.c:382:2: note: in expansion of macro ‘LOGP’ LOGP(DLSMS, LOGL_INFO, "TPDU(%li,%s)\n", msg->tail-msg->l4h, ^~~~ gsm411_sms.c:382:25: warning: format ‘%li’ expects argument of type ‘long int’, but argument 7 has type ‘int’ [-Wformat=] LOGP(DLSMS, LOGL_INFO, "TPDU(%li,%s)\n", msg->tail-msg->l4h, ^ /home/ich/install/openbsc/include/osmocom/core/logging.h:95:53: note: in definition of macro ‘LOGPSRCC’ logp2(ss, level, __BASE_FILE__, __LINE__, cont, fmt, ##args); \ ^~~ /home/ich/install/openbsc/include/osmocom/core/logging.h:47:2: note: in expansion of macro ‘LOGPSRC’ LOGPSRC(ss, level, NULL, 0, fmt, ## args) ^~~~~~~ gsm411_sms.c:382:2: note: in expansion of macro ‘LOGP’ LOGP(DLSMS, LOGL_INFO, "TPDU(%li,%s)\n", msg->tail-msg->l4h, Change-Id: Ia574fc7849bd00a94cf6651eb0d26fdc91ef1443
-rw-r--r--src/host/layer23/src/mobile/gsm411_sms.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/host/layer23/src/mobile/gsm411_sms.c b/src/host/layer23/src/mobile/gsm411_sms.c
index eb09854b..b635bb2f 100644
--- a/src/host/layer23/src/mobile/gsm411_sms.c
+++ b/src/host/layer23/src/mobile/gsm411_sms.c
@@ -375,7 +375,7 @@ static int gsm411_rx_rp_ud(struct msgb *msg, struct gsm_trans *trans,
LOGP(DLSMS, LOGL_INFO, "DST(%u,%s)\n", src_len,
osmo_hexdump(src, src_len));
- LOGP(DLSMS, LOGL_INFO, "TPDU(%li,%s)\n", msg->tail-msg->l4h,
+ LOGP(DLSMS, LOGL_INFO, "TPDU(%ti,%s)\n", msg->tail-msg->l4h,
osmo_hexdump(msg->l4h, msg->tail-msg->l4h));
rc = gsm340_rx_tpdu(trans, msg, rph->msg_ref);