From e163c74b90e5d27ec72444e34dcbf5f2e2a640bb Mon Sep 17 00:00:00 2001 From: Ville Juven Date: Wed, 23 Aug 2023 15:59:23 +0300 Subject: [PATCH] rpmsg/rpmsg_sockif.c: Fix printf format for u64 type Use PRIx64 which defines the width correctly regardless or architecture. Fixes build error: rpmsg/rpmsg_sockif.c:610:57: error: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'uint64_t' {aka 'long unsigned int'} [-Werror=format=] 610 | snprintf(conn->nameid, sizeof(conn->nameid), ":%llx", g_rpmsg_id++); | ~~~^ ~~~~~~~~~~~~ | | | | | uint64_t {aka long unsigned int} | long long unsigned int | %lx --- net/rpmsg/rpmsg_sockif.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/rpmsg/rpmsg_sockif.c b/net/rpmsg/rpmsg_sockif.c index 7fcc0ecf8e2..10b67d2f618 100644 --- a/net/rpmsg/rpmsg_sockif.c +++ b/net/rpmsg/rpmsg_sockif.c @@ -607,7 +607,8 @@ static int rpmsg_socket_setaddr(FAR struct rpmsg_socket_conn_s *conn, if (suffix) { - snprintf(conn->nameid, sizeof(conn->nameid), ":%llx", g_rpmsg_id++); + snprintf(conn->nameid, sizeof(conn->nameid), ":%" PRIx64, + g_rpmsg_id++); } else {