mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 17:33:08 +08:00
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
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user