From a938e45c611902d6387081fa57336b1f4a5b7207 Mon Sep 17 00:00:00 2001 From: Zachary Henkel Date: Tue, 10 Sep 2024 11:06:17 -0700 Subject: [PATCH] Prevent `-Wcast-function-type-mismatch` diagnostics from clang --- lib/include/public/mat.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/include/public/mat.h b/lib/include/public/mat.h index 3ad8d36f7..535e0ac3a 100644 --- a/lib/include/public/mat.h +++ b/lib/include/public/mat.h @@ -370,7 +370,8 @@ extern "C" { { #ifdef _WIN32 /* This code accepts a handle of a library loaded in customer's code */ - evt_app_call_t impl = (evt_app_call_t)GetProcAddress((HMODULE)handle, "evt_api_call_default"); + /* The intermediate (void*) cast prevents incompatible function type cast diagnostics */ + evt_app_call_t impl = (evt_app_call_t)(void*)GetProcAddress((HMODULE)handle, "evt_api_call_default"); if (impl != NULL) { evt_api_call = impl;