From ab106a69e14b424158e270cb84038e9cda204cf7 Mon Sep 17 00:00:00 2001 From: TomJoey Date: Sat, 15 Aug 2026 18:49:51 -0700 Subject: [PATCH] Fix invalid const-qualified function pointer in delayimp.cpp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GetProcAddress returns FARPROC (a function pointer), and `auto const *real = ...` deduces `real` as a pointer to a const-qualified function type, which is not a meaningful/well-formed declaration. clang-cl rejects it outright under -m32: error: variable 'real' with type 'const auto *' has incompatible initializer of type 'FARPROC' This branch is guarded by `#if defined(_M_IX86) || defined(__i386__)`, which the project's own Windows CI matrix (x64/arm64 only) never builds, so the break went unnoticed. Every other pointer in this file (e.g. the `LoadLibrary` results a few lines up) uses the `auto *const` form instead — a non-reassignable pointer to non-const data — which is almost certainly what was intended here too. Switching to that form fixes the x86 clang-cl build without changing behavior. Signed-off-by: TomJoey --- source/delayimp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/delayimp.cpp b/source/delayimp.cpp index e58144b..4b4288c 100644 --- a/source/delayimp.cpp +++ b/source/delayimp.cpp @@ -987,7 +987,7 @@ static FARPROC WINAPI DelayLoadFailureHook(unsigned dliNotify, const auto at = name.find('@'); if (at != std::string_view::npos) { const std::string undecorated(name.substr(0, at)); - if (auto const *real = + if (auto *const real = GetProcAddress(pdli->hmodCur, undecorated.c_str()); real != nullptr) { log.info("recovered '{}!{}' via undecorated name", pdli->szDll,