[compiler-rt] 835ae52 - [compiler-rt] Fix asan_interceptors.cpp build warning -Wunused-template (#209750)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 15 12:57:37 PDT 2026
Author: Wenju He
Date: 2026-07-15T12:57:32-07:00
New Revision: 835ae525713e27aa98c46469792cee980669c6ca
URL: https://github.com/llvm/llvm-project/commit/835ae525713e27aa98c46469792cee980669c6ca
DIFF: https://github.com/llvm/llvm-project/commit/835ae525713e27aa98c46469792cee980669c6ca.diff
LOG: [compiler-rt] Fix asan_interceptors.cpp build warning -Wunused-template (#209750)
mmap_interceptor/munmap_interceptor template functions are instantiated
in sanitizer_common_interceptors.inc only under `#if
SANITIZER_INTERCEPT_MMAP`. Fix `unused function template
'mmap_interceptor'` warning on Windows, which is error under -Werror.
Added:
Modified:
compiler-rt/lib/asan/asan_interceptors.cpp
Removed:
################################################################################
diff --git a/compiler-rt/lib/asan/asan_interceptors.cpp b/compiler-rt/lib/asan/asan_interceptors.cpp
index 5075919a47d50..4e91e34f76cee 100644
--- a/compiler-rt/lib/asan/asan_interceptors.cpp
+++ b/compiler-rt/lib/asan/asan_interceptors.cpp
@@ -178,6 +178,7 @@ DECLARE_REAL_AND_INTERCEPTOR(void, free, void*)
*begin = *end = 0; \
}
+# if SANITIZER_INTERCEPT_MMAP
template <class Mmap>
static void* mmap_interceptor(Mmap real_mmap, void* addr, SIZE_T length,
int prot, int flags, int fd, OFF64_T offset) {
@@ -243,6 +244,7 @@ static int munmap_interceptor(Munmap real_munmap, void* addr, SIZE_T length) {
}
return real_munmap(addr, length);
}
+# endif // SANITIZER_INTERCEPT_MMAP
# define COMMON_INTERCEPTOR_MMAP_IMPL(ctx, mmap, addr, length, prot, flags, \
fd, offset) \
More information about the llvm-commits
mailing list