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/08/30 14:53:07 UTC

[incubator-nuttx] branch master updated: Fixed warnings in various prints.

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 484bdc54d3 Fixed warnings in various prints.
484bdc54d3 is described below

commit 484bdc54d3316c6b9e1892f15cfc938e83245849
Author: Fotis Panagiotopoulos <f....@amco.gr>
AuthorDate: Tue Aug 30 14:41:01 2022 +0300

    Fixed warnings in various prints.
---
 fs/procfs/fs_procfsproc.c |  2 +-
 mm/kasan/kasan.c          |  3 ++-
 mm/ubsan/ubsan.c          | 10 +++++-----
 3 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/fs/procfs/fs_procfsproc.c b/fs/procfs/fs_procfsproc.c
index 56cf64fb10..f628753fa2 100644
--- a/fs/procfs/fs_procfsproc.c
+++ b/fs/procfs/fs_procfsproc.c
@@ -993,7 +993,7 @@ static ssize_t proc_heapcheck(FAR struct proc_file_s *procfile,
       heapcheck = 1;
     }
 
-  linesize = procfs_snprintf(procfile->line, STATUS_LINELEN, "%-12s%d\n",
+  linesize = procfs_snprintf(procfile->line, STATUS_LINELEN, "%-12s%zu\n",
                              "HeapCheck:", heapcheck);
 
   copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining,
diff --git a/mm/kasan/kasan.c b/mm/kasan/kasan.c
index 5d5a59a571..7199c64ee0 100644
--- a/mm/kasan/kasan.c
+++ b/mm/kasan/kasan.c
@@ -101,7 +101,8 @@ static void kasan_report(FAR const void *addr, size_t size, bool is_write)
   if (++recursion == 1)
     {
       _alert("kasan detected a %s access error, address at %0#"PRIxPTR
-            ", size is %zu\n", is_write ? "write" : "read", addr, size);
+            ", size is %zu\n", is_write ? "write" : "read",
+            (uintptr_t)addr, size);
       PANIC();
     }
 
diff --git a/mm/ubsan/ubsan.c b/mm/ubsan/ubsan.c
index 54b101d94b..a306e37e86 100644
--- a/mm/ubsan/ubsan.c
+++ b/mm/ubsan/ubsan.c
@@ -284,18 +284,18 @@ void __ubsan_handle_alignment_assumption(FAR void *data, uintptr_t ptr,
 
   if (offset)
     {
-      _alert("assumption of %u byte alignment (with offset of %u byte) for "
-             "pointer of type %s failed",
+      _alert("assumption of %zu byte alignment (with offset of %zu byte) for"
+             " pointer of type %s failed",
              align, offset, info->type->type_name);
     }
   else
     {
-      _alert("assumption of %u byte alignment for pointer of type %s failed",
-             align, info->type->type_name);
+      _alert("assumption of %zu byte alignment for pointer of type %s "
+             "failed", align, info->type->type_name);
     }
 
   real_ptr = ptr - offset;
-  _alert("%saddress is %lu aligned, misalignment offset is %u bytes",
+  _alert("%saddress is %lu aligned, misalignment offset is %zu bytes",
          offset ? "offset " : "",
          1ul << (real_ptr ? ffsl(real_ptr) : 0),
          real_ptr & (align - 1));