<div dir="ltr">Could these functions be attributed `unused` to suppress the warning instead? (so each use of this .inc file doesn't have to add the pragmas)</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, May 16, 2023 at 10:01 PM Jie Fu via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Author: Jie Fu<br>
Date: 2023-05-17T13:00:50+08:00<br>
New Revision: 000aeb2499b1db510f064c37c097a5020215b835<br>
<br>
URL: <a href="https://github.com/llvm/llvm-project/commit/000aeb2499b1db510f064c37c097a5020215b835" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/000aeb2499b1db510f064c37c097a5020215b835</a><br>
DIFF: <a href="https://github.com/llvm/llvm-project/commit/000aeb2499b1db510f064c37c097a5020215b835.diff" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/000aeb2499b1db510f064c37c097a5020215b835.diff</a><br>
<br>
LOG: [hwasan] Fix build breakage (-Wunused-function) in hwasan_interceptors.cpp (NFC)<br>
<br>
In file included from /data/llvm-project/compiler-rt/lib/hwasan/hwasan_interceptors.cpp:141:<br>
/data/llvm-project/compiler-rt/lib/hwasan/../sanitizer_common/sanitizer_common_interceptors.inc:1044:13: error: unused function 'write_iovec' [-Werror,-Wunused-function]<br>
static void write_iovec(void *ctx, struct __sanitizer_iovec *iovec,<br>
            ^<br>
/data/llvm-project/compiler-rt/lib/hwasan/../sanitizer_common/sanitizer_common_interceptors.inc:1053:13: error: unused function 'read_iovec' [-Werror,-Wunused-function]<br>
static void read_iovec(void *ctx, struct __sanitizer_iovec *iovec,<br>
            ^<br>
/data/llvm-project/compiler-rt/lib/hwasan/../sanitizer_common/sanitizer_common_interceptors.inc:10363:13: error: unused function 'InitializeCommonInterceptors' [-Werror,-Wunused-function]<br>
static void InitializeCommonInterceptors() {<br>
            ^<br>
3 errors generated.<br>
<br>
Added: <br>
<br>
<br>
Modified: <br>
    compiler-rt/lib/hwasan/hwasan_interceptors.cpp<br>
<br>
Removed: <br>
<br>
<br>
<br>
################################################################################<br>
diff  --git a/compiler-rt/lib/hwasan/hwasan_interceptors.cpp b/compiler-rt/lib/hwasan/hwasan_interceptors.cpp<br>
index f5099c2a835f..57df79d15123 100644<br>
--- a/compiler-rt/lib/hwasan/hwasan_interceptors.cpp<br>
+++ b/compiler-rt/lib/hwasan/hwasan_interceptors.cpp<br>
@@ -138,7 +138,10 @@ using namespace __hwasan;<br>
     (void)(name);                       \<br>
   } while (false)<br>
<br>
+#pragma clang diagnostic push<br>
+#pragma clang diagnostic ignored "-Wunused-function"<br>
 #include "sanitizer_common/sanitizer_common_interceptors.inc"<br>
+#pragma clang diagnostic pop<br>
<br>
 struct ThreadStartArg {<br>
   __sanitizer_sigset_t starting_sigset_;<br>
<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>