From 81d06268f47f089335076eb608c880fc0e60a677 Mon Sep 17 00:00:00 2001 From: Thurston Dang Date: Fri, 28 Apr 2023 02:50:09 +0000 Subject: [PATCH] [hwasan] Fix -Wunneeded-internal-declaration by declaring static inline https://reviews.llvm.org/D149386 caused a buildbot error (https://lab.llvm.org/buildbot#builders/37/builds/21766): 'In file included from /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/hwasan/hwasan_interceptors.cpp:18: /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/hwasan/hwasan_checks.h:128:53: error: 'static' function 'PossiblyShortTagMatches' declared in header file should be declared 'static inline' [-Werror,-Wunneeded-internal-declaration] __attribute__((always_inline, nodebug)) static bool PossiblyShortTagMatches(' This patch simply adds the inline annotation. Differential Revision: https://reviews.llvm.org/D149402 --- compiler-rt/lib/hwasan/hwasan_checks.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler-rt/lib/hwasan/hwasan_checks.h b/compiler-rt/lib/hwasan/hwasan_checks.h index 514d351cf7d7..6e2ab1693b53 100644 --- a/compiler-rt/lib/hwasan/hwasan_checks.h +++ b/compiler-rt/lib/hwasan/hwasan_checks.h @@ -125,8 +125,8 @@ __attribute__((always_inline)) static void SigTrap(uptr p, uptr size) { // __builtin_unreachable(); } -__attribute__((always_inline, nodebug)) static bool PossiblyShortTagMatches( - tag_t mem_tag, uptr ptr, uptr sz) { +__attribute__((always_inline, nodebug)) static inline bool +PossiblyShortTagMatches(tag_t mem_tag, uptr ptr, uptr sz) { tag_t ptr_tag = GetTagFromPointer(ptr); if (ptr_tag == mem_tag) return true;