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.git

commit c5bfc4d233cb80cd3693996a4546925f728f31fc
Author: buxiasen <buxia...@xiaomi.com>
AuthorDate: Tue Apr 15 18:33:20 2025 +0800

    mm/kasan: fix wanring expression result unused
    
    nuttx/mm/mm_heap/mm_malloc_size.c:77:16: error: expression result unused 
[-Werror,-Wunused-value]
      kasan_bypass(flag);
                   ^~~~
    Signed-off-by: buxiasen <buxia...@xiaomi.com>
---
 include/nuttx/mm/kasan.h    | 2 +-
 mm/mm_heap/mm_malloc_size.c | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/nuttx/mm/kasan.h b/include/nuttx/mm/kasan.h
index 4c595fbfd4..9cf6fb4820 100644
--- a/include/nuttx/mm/kasan.h
+++ b/include/nuttx/mm/kasan.h
@@ -48,7 +48,7 @@
 #  define kasan_stop()
 #  define kasan_debugpoint(t,a,s) 0
 #  define kasan_init_early()
-#  define kasan_bypass(state) (state)
+#  define kasan_bypass(state) false
 #else
 
 #  define kasan_init_early() kasan_stop()
diff --git a/mm/mm_heap/mm_malloc_size.c b/mm/mm_heap/mm_malloc_size.c
index 895f11ee2b..544b0e306e 100644
--- a/mm/mm_heap/mm_malloc_size.c
+++ b/mm/mm_heap/mm_malloc_size.c
@@ -75,5 +75,6 @@ size_t mm_malloc_size(FAR struct mm_heap_s *heap, FAR void 
*mem)
   size = MM_SIZEOF_NODE(node) - MM_ALLOCNODE_OVERHEAD;
 
   kasan_bypass(flag);
+  UNUSED(flag);
   return size;
 }

Reply via email to