From cae7ef260458f66b4c6b2b8075db7cb6afe6bf9e Mon Sep 17 00:00:00 2001 From: Thurston Dang Date: Wed, 17 May 2023 03:22:09 +0000 Subject: [PATCH] hwasan: fix buildbot breakage (unused variables) This (hopefully) fixes the buildbot breakage: https://lab.llvm.org/buildbot/#/builders/77/builds/26793 My patch, https://reviews.llvm.org/D150708 introduced stubs for common interceptor macros; these had unused variables. This patch suppresses unused-variable warnings. --- compiler-rt/lib/hwasan/hwasan_interceptors.cpp | 35 +++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/compiler-rt/lib/hwasan/hwasan_interceptors.cpp b/compiler-rt/lib/hwasan/hwasan_interceptors.cpp index 9763040..f5099c2 100644 --- a/compiler-rt/lib/hwasan/hwasan_interceptors.cpp +++ b/compiler-rt/lib/hwasan/hwasan_interceptors.cpp @@ -51,50 +51,82 @@ using namespace __hwasan; #define COMMON_INTERCEPTOR_READ_RANGE(ctx, ptr, size) \ do { \ + (void)(ctx); \ + (void)(ptr); \ + (void)(size); \ } while (false) #define COMMON_INTERCEPTOR_ENTER(ctx, func, ...) \ do { \ + (void)(ctx); \ + (void)(func); \ } while (false) #define COMMON_INTERCEPTOR_DIR_ACQUIRE(ctx, path) \ - do { \ + do { \ + (void)(ctx); \ + (void)(path); \ } while (false) #define COMMON_INTERCEPTOR_FD_ACQUIRE(ctx, fd) \ do { \ + (void)(ctx); \ + (void)(fd); \ } while (false) #define COMMON_INTERCEPTOR_FD_RELEASE(ctx, fd) \ do { \ + (void)(ctx); \ + (void)(fd); \ } while (false) #define COMMON_INTERCEPTOR_FD_SOCKET_ACCEPT(ctx, fd, newfd) \ do { \ + (void)(ctx); \ + (void)(fd); \ + (void)(newfd); \ } while (false) #define COMMON_INTERCEPTOR_SET_THREAD_NAME(ctx, name) \ do { \ + (void)(ctx); \ + (void)(name); \ } while (false) #define COMMON_INTERCEPTOR_SET_PTHREAD_NAME(ctx, thread, name) \ do { \ + (void)(ctx); \ + (void)(thread); \ + (void)(name); \ } while (false) #define COMMON_INTERCEPTOR_BLOCK_REAL(name) \ do { \ + (void)(name); \ } while (false) #define COMMON_INTERCEPTOR_MEMMOVE_IMPL(ctx, to, from, size) \ do { \ + (void)(ctx); \ + (void)(to); \ + (void)(from); \ + (void)(size); \ } while (false) #define COMMON_INTERCEPTOR_MEMCPY_IMPL(ctx, to, from, size) \ do { \ + (void)(ctx); \ + (void)(to); \ + (void)(from); \ + (void)(size); \ } while (false) #define COMMON_INTERCEPTOR_MEMSET_IMPL(ctx, block, c, size) \ do { \ + (void)(ctx); \ + (void)(block); \ + (void)(c); \ + (void)(size); \ } while (false) #define COMMON_INTERCEPTOR_STRERROR() \ @@ -103,6 +135,7 @@ using namespace __hwasan; #define COMMON_INTERCEPT_FUNCTION(name) \ do { \ + (void)(name); \ } while (false) #include "sanitizer_common/sanitizer_common_interceptors.inc" -- 2.7.4