From 4e62ec0b3cea603f184a83f964330db709eed4a5 Mon Sep 17 00:00:00 2001 From: ziper Date: Mon, 26 May 2025 07:01:08 +0000 Subject: [PATCH] fix codecheck warning Signed-off-by: ziper --- compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp | 3 ++- compiler-rt/lib/gwp_asan/guarded_pool_allocator.h | 2 +- .../lib/gwp_asan/optional/print_backtrace_linux_libc.inc | 3 +++ compiler-rt/lib/hwasan/hwasan.cpp | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp b/compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp index 47160942daca..069d58101cb9 100644 --- a/compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp +++ b/compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp @@ -76,7 +76,8 @@ void GuardedPoolAllocator::init(const options::Options &Opts) { State.MaxSimultaneousAllocations = Opts.MaxSimultaneousAllocations; // OHOS_LOCAL begin #if defined (__OHOS__) - MUSL_LOG("[gwp_asan]: SlotLength %{public}d, SampleRate %{public}d", Opts.MaxSimultaneousAllocations, Opts.SampleRate); + MUSL_LOG("[gwp_asan]: SlotLength %{public}d, SampleRate %{public}d", + Opts.MaxSimultaneousAllocations, Opts.SampleRate); #endif // OHOS_LOCAL end diff --git a/compiler-rt/lib/gwp_asan/guarded_pool_allocator.h b/compiler-rt/lib/gwp_asan/guarded_pool_allocator.h index 0ead83f09aa0..1f41d5073020 100644 --- a/compiler-rt/lib/gwp_asan/guarded_pool_allocator.h +++ b/compiler-rt/lib/gwp_asan/guarded_pool_allocator.h @@ -27,7 +27,7 @@ #define MUSL_LOG(fmt,...) \ if(&musl_log) { \ musl_log(fmt, __VA_ARGS__); \ - }; \ + } extern "C" GWP_ASAN_WEAK int musl_log(const char *fmt, ...); #endif diff --git a/compiler-rt/lib/gwp_asan/optional/print_backtrace_linux_libc.inc b/compiler-rt/lib/gwp_asan/optional/print_backtrace_linux_libc.inc index 5a91746e8dc3..7f33e914d7ab 100644 --- a/compiler-rt/lib/gwp_asan/optional/print_backtrace_linux_libc.inc +++ b/compiler-rt/lib/gwp_asan/optional/print_backtrace_linux_libc.inc @@ -1,3 +1,5 @@ +#ifndef PRINT_BACKTRACE_LINUX_LIBC +#define PRINT_BACKTRACE_LINUX_LIBC //===-- print_backtrace_linux_libc.inc --------------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. @@ -41,3 +43,4 @@ void PrintBacktrace(uintptr_t *Trace, size_t TraceLength, free(BacktraceSymbols); } } // anonymous namespace +#endif \ No newline at end of file diff --git a/compiler-rt/lib/hwasan/hwasan.cpp b/compiler-rt/lib/hwasan/hwasan.cpp index 100ba39a7a29..84b4ebd6f246 100644 --- a/compiler-rt/lib/hwasan/hwasan.cpp +++ b/compiler-rt/lib/hwasan/hwasan.cpp @@ -72,7 +72,7 @@ static void RegisterHwasanFlags(FlagParser *parser, Flags *f) { #define APPEND_BOOL_FLAG_CONETENT(defalutFlags, flags, S, param) \ defalutFlags.append(#S " is "); \ - defalutFlags.append(flags->S == param ? "true. " : "false. "); + defalutFlags.append(flags->S == param ? "true. " : "false. ") static void InitializeFlags() { SetCommonFlagsDefaults(); -- Gitee