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 2022/09/06 10:24:26 UTC

[incubator-nuttx] branch master updated: net/mld/route: fix build 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/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 0978dcf88d net/mld/route: fix build warning
0978dcf88d is described below

commit 0978dcf88d9f3ea63ddda6af90ef2a00c4b6898a
Author: chao an <an...@xiaomi.com>
AuthorDate: Tue Sep 6 16:29:42 2022 +0800

    net/mld/route: fix build warning
    
    In file included from route/net_del_ramroute.c:30:
    route/net_del_ramroute.c: In function ‘net_match_ipv4’:
    route/net_del_ramroute.c:93:9: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘unsigned int’ [-Wformat=]
       93 |   ninfo("  target=%08lx netmask=%08lx\n",
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    route/net_del_ramroute.c:93:23: note: format string is defined here
       93 |   ninfo("  target=%08lx netmask=%08lx\n",
          |                   ~~~~^
          |                       |
          |                       long unsigned int
          |                   %08x
    
    mld/mld_timer.c: In function ‘mld_gendog_work’:
    mld/mld_timer.c:118:13: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
      118 |   ifindex = (int)arg;
          |             ^
    mld/mld_timer.c: In function ‘mld_v1dog_work’:
    mld/mld_timer.c:237:13: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
      237 |   ifindex = (int)arg;
          |             ^
    
    Signed-off-by: chao an <an...@xiaomi.com>
---
 net/mld/mld_timer.c          | 4 ++--
 net/route/net_del_ramroute.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/mld/mld_timer.c b/net/mld/mld_timer.c
index da8f830010..9b98165ffa 100644
--- a/net/mld/mld_timer.c
+++ b/net/mld/mld_timer.c
@@ -115,7 +115,7 @@ static void mld_gendog_work(FAR void *arg)
    * index.
    */
 
-  ifindex = (int)arg;
+  ifindex = (intptr_t)arg;
   DEBUGASSERT(ifindex > 0);
 
   net_lock();
@@ -234,7 +234,7 @@ static void mld_v1dog_work(FAR void *arg)
    * index.
    */
 
-  ifindex = (int)arg;
+  ifindex = (intptr_t)arg;
   DEBUGASSERT(ifindex > 0);
 
   net_lock();
diff --git a/net/route/net_del_ramroute.c b/net/route/net_del_ramroute.c
index f50fcf882c..a6b334f879 100644
--- a/net/route/net_del_ramroute.c
+++ b/net/route/net_del_ramroute.c
@@ -90,7 +90,7 @@ static int net_match_ipv4(FAR struct net_route_ipv4_s *route, FAR void *arg)
 
   net_ipv4_dumproute("Comparing", route);
   ninfo("With:\n");
-  ninfo("  target=%08lx netmask=%08lx\n",
+  ninfo("  target=%08" PRIu32 " netmask=%08" PRIu32 "\n",
         HTONL(match->target), HTONL(match->netmask));
 
   if (net_ipv4addr_maskcmp(route->target, match->target, match->netmask) &&