anchao opened a new pull request #5792:
URL: https://github.com/apache/incubator-nuttx/pull/5792


   ## Summary
   
   fs/nfs: fix compile warning
   
   ```
   In file included from nfs/nfs_vfsops.c:65:
   nfs/nfs_vfsops.c: In function ‘nfs_read’:
   nfs/nfs_vfsops.c:906:13: warning: format ‘%d’ expects argument of type 
‘int’, but argument 3 has type ‘size_t’ {aka ‘long unsigned int’} [-Wformat=]
     906 |       finfo("Read size truncated to %d\n", buflen);
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~
         |                                            |
         |                                            size_t {aka long unsigned 
int}
   nfs/nfs_vfsops.c:906:38: note: format string is defined here
     906 |       finfo("Read size truncated to %d\n", buflen);
         |                                     ~^
         |                                      |
         |                                      int
         |                                     %ld
   In file included from nfs/nfs_vfsops.c:65:
   nfs/nfs_vfsops.c:960:13: warning: format ‘%d’ expects argument of type 
‘int’, but argument 3 has type ‘ssize_t’ {aka ‘long int’} [-Wformat=]
     960 |       finfo("Reading %d bytes\n", readsize);
         |             ^~~~~~~~~~~~~~~~~~~~  ~~~~~~~~
         |                                   |
         |                                   ssize_t {aka long int}
   nfs/nfs_vfsops.c:960:23: note: format string is defined here
     960 |       finfo("Reading %d bytes\n", readsize);
         |                      ~^
         |                       |
         |                       int
         |                      %ld
   
   
   nfs/rpc_clnt.c: In function ‘rpcclnt_connect’:
   nfs/rpc_clnt.c:591:3: warning: ‘strncpy’ specified bound 90 equals 
destination size [-Wstringop-truncation]
     591 |   strncpy(request.mountd.mount.rpath, rpc->rc_path, 90);
         |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   make[3]: Entering directory '/home/archer/code/nuttx/n2/apps/platform'
   nfs/rpc_clnt.c: In function ‘rpcclnt_disconnect’:
   nfs/rpc_clnt.c:719:3: warning: ‘strncpy’ specified bound 90 equals 
destination size [-Wstringop-truncation]
     719 |   strncpy(request.mountd.umount.rpath, rpc->rc_path, 90);
         |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   netdb/lib_getaddrinfo.c: In function ‘alloc_ai’:
   netdb/lib_getaddrinfo.c:80:9: warning: ‘strncpy’ specified bound 108 equals 
destination size [-Wstringop-truncation]
      80 |         strncpy(ai->sa.sun.sun_path, addr, 
sizeof(ai->sa.sun.sun_path));
         |         
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   nfs/nfs_vfsops.c: In function ‘nfs_bind’:
   nfs/nfs_vfsops.c:2009:3: warning: ‘strncpy’ specified bound 90 equals 
destination size [-Wstringop-truncation]
    2009 |   strncpy(nmp->nm_path, argp->path, 90);
         |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   
   ```
   
   
   
   ## Impact
   
   N/A
   
   ## Testing
   
   ci-check


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to