[compiler-rt] [win/asan] Avoid warnings in interception_win.cpp. (PR #118143)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 29 15:25:17 PST 2024
https://github.com/bernhardu created https://github.com/llvm/llvm-project/pull/118143
warning: format specifies type 'void *' but the argument has type 'uptr' (aka 'unsigned long long') [-Wformat] (observed at x86_64, in AllocateTrampolineRegion)
warning: format specifies type 'char *' but the argument has type 'RVAPtr<char>' [-Wformat] (observed at x86_64, in InternalGetProcAddress)
>From a7ec338b1320b8d6848457ebd73b4487dd35e0a7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bernhard=20=C3=9Cbelacker?= <bernhardu at mailbox.org>
Date: Sun, 24 Nov 2024 14:50:51 +0100
Subject: [PATCH] [win/asan] Avoid warnings in interception_win.cpp.
warning: format specifies type 'void *' but the argument has type 'uptr' (aka 'unsigned long long') [-Wformat]
(observed at x86_64, in AllocateTrampolineRegion)
warning: format specifies type 'char *' but the argument has type 'RVAPtr<char>' [-Wformat]
(observed at x86_64, in InternalGetProcAddress)
---
compiler-rt/lib/interception/interception_win.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/compiler-rt/lib/interception/interception_win.cpp b/compiler-rt/lib/interception/interception_win.cpp
index dc3018a675dee2..93886e79fd88c8 100644
--- a/compiler-rt/lib/interception/interception_win.cpp
+++ b/compiler-rt/lib/interception/interception_win.cpp
@@ -418,7 +418,7 @@ static void *AllocateTrampolineRegion(uptr min_addr, uptr max_addr,
ReportError(
"interception_win: AllocateTrampolineRegion failed to find free memory; "
"min_addr: %p, max_addr: %p, func_addr: %p, granularity: %zu\n",
- (void *)min_addr, (void *)max_addr, granularity);
+ (void *)min_addr, (void *)max_addr, (void *)func_addr, granularity);
return nullptr;
#else
return ::VirtualAlloc(nullptr,
@@ -1247,7 +1247,7 @@ uptr InternalGetProcAddress(void *module, const char *func_name) {
char function_name[256];
size_t funtion_name_length = _strlen(func);
if (funtion_name_length >= sizeof(function_name) - 1) {
- ReportError("interception_win: func too long: '%s'\n", func);
+ ReportError("interception_win: func too long: '%s'\n", (char *)func);
InterceptionFailed();
}
More information about the llvm-commits
mailing list