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
This commit is contained in:
Holger Hans Peter Freyther 2017-12-03 12:57:07 +00:00
parent 271cdad401
commit 229ea1ca5b
1 changed files with 1 additions and 1 deletions

View File

@ -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);