[PATCH] osmocom-bb[master]: mobile/primitives.c: fix format string compiler warning

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/.

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Sat Feb 10 13:03:08 UTC 2018


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

mobile/primitives.c: fix format string compiler warning

The recent LUA integration code introduced the following
compiler warnings (on GCC 4.8.5):

primitives.c: In function ‘create_timer’:
primitives.c:90:2: warning: format ‘%llu’ expects argument of
                   type ‘long long unsigned int’,
                   but argument 7 has type ‘uint64_t’ [-Wformat=]

primitives.c: In function ‘cancel_timer’:
primitives.c:166:3: warning: format ‘%llu’ expects argument of
                   type ‘long long unsigned int’,
                   but argument 7 has type ‘uint64_t’ [-Wformat=]

The recommended and portable way of printing an 'uint64_t'
is to use the corresponding macros 'PRIu64'.

Change-Id: Ic7f54063a35a89ad54dfa63868f43009cbe469bb
---
M src/host/layer23/src/mobile/primitives.c
1 file changed, 7 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/63/6363/1

diff --git a/src/host/layer23/src/mobile/primitives.c b/src/host/layer23/src/mobile/primitives.c
index c3f28a5..96f0f9c 100644
--- a/src/host/layer23/src/mobile/primitives.c
+++ b/src/host/layer23/src/mobile/primitives.c
@@ -18,6 +18,8 @@
  *
  */
 
+#include <inttypes.h>
+
 #include <osmocom/bb/mobile/primitives.h>
 #include <osmocom/bb/common/logging.h>
 
@@ -87,7 +89,8 @@
 {
 	struct timer_closure *closure;
 
-	LOGP(DPRIM, LOGL_DEBUG, "Creating timer with reference: %llu\n", param->timer_id);
+	LOGP(DPRIM, LOGL_DEBUG, "Creating timer with reference: "
+		"%" PRIu64 "\n", param->timer_id);
 
 	closure = talloc_zero(intf, struct timer_closure);
 	closure->intf = intf;
@@ -163,8 +166,9 @@
 		if (closure->id != param->timer_id)
 			continue;
 
-		LOGP(DPRIM, LOGL_DEBUG,
-			"Canceling timer with reference: %llu\n", param->timer_id);
+		LOGP(DPRIM, LOGL_DEBUG, "Canceling timer with reference: "
+			"%" PRIu64 "\n", param->timer_id);
+
 		osmo_timer_del(&closure->timer);
 		llist_del(&closure->entry);
 		talloc_free(closure);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic7f54063a35a89ad54dfa63868f43009cbe469bb
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>



More information about the gerrit-log mailing list