You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2024/01/12 09:22:29 UTC

(nuttx-apps) branch master updated: rpsock_client.c: fix printf format warning

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new 5f1de3593 rpsock_client.c: fix printf format warning
5f1de3593 is described below

commit 5f1de359364f33ede018f54ff5deff3819c9368c
Author: wangyongrong <wa...@xiaomi.com>
AuthorDate: Wed Dec 20 17:38:42 2023 +0800

    rpsock_client.c: fix printf format warning
    
    rpsock_client.c:203:30: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 5 has type ‘long unsigned int’ [-Wformat=]
      203 |                       printf("client check fail total %d, \
          |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      204 |                               i %d, %08" PRIx32 ", %08x\n",
          |                               ~~~~~~~~~~
      205 |                               ALIGN_UP(total), i, intp[i],
      206 |                               (ALIGN_UP(total) / sizeof(uint32_t) + i));
          |                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          |                                                                   |
          |                                                                   long unsigned int
    
    Signed-off-by: wangyongrong <wa...@xiaomi.com>
---
 examples/rpmsgsocket/rpsock_client.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/rpmsgsocket/rpsock_client.c b/examples/rpmsgsocket/rpsock_client.c
index b35d60598..9415dbffd 100644
--- a/examples/rpmsgsocket/rpsock_client.c
+++ b/examples/rpmsgsocket/rpsock_client.c
@@ -201,7 +201,7 @@ static int rpsock_unsync_test(struct rpsock_arg_s *args)
                   if (intp[i] != ALIGN_UP(total) / sizeof(uint32_t) + i)
                     {
                       printf("client check fail total %d, \
-                              i %d, %08" PRIx32 ", %08x\n",
+                              i %d, %08" PRIx32 ", %08zx\n",
                               ALIGN_UP(total), i, intp[i],
                               ALIGN_UP(total) / sizeof(uint32_t) + i);
                     }