[compiler-rt] cae7ef2 - hwasan: fix buildbot breakage (unused variables)

Thurston Dang via llvm-commits llvm-commits at lists.llvm.org
Tue May 16 20:22:35 PDT 2023


Author: Thurston Dang
Date: 2023-05-17T03:22:09Z
New Revision: cae7ef260458f66b4c6b2b8075db7cb6afe6bf9e

URL: https://github.com/llvm/llvm-project/commit/cae7ef260458f66b4c6b2b8075db7cb6afe6bf9e
DIFF: https://github.com/llvm/llvm-project/commit/cae7ef260458f66b4c6b2b8075db7cb6afe6bf9e.diff

LOG: 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.

Added: 
    

Modified: 
    compiler-rt/lib/hwasan/hwasan_interceptors.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/hwasan/hwasan_interceptors.cpp b/compiler-rt/lib/hwasan/hwasan_interceptors.cpp
index 97630407f7a5..f5099c2a835f 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"


        


More information about the llvm-commits mailing list