From 2cd155ff2a92f99a7d90cf2215022653cf00dcf9 Mon Sep 17 00:00:00 2001 From: Ihor Dutchak Date: Sun, 1 Mar 2026 12:01:05 +0200 Subject: [PATCH 1/2] Fix funciton pointer cast warning win backend Fix function pointer cast warning when compiling windows backend with strict compiler settings. --- windows/hid.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/windows/hid.c b/windows/hid.c index 59ec617e..448e4aa8 100644 --- a/windows/hid.c +++ b/windows/hid.c @@ -138,11 +138,13 @@ static int lookup_functions() goto err; } -#if defined(__GNUC__) -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wcast-function-type" -#endif -#define RESOLVE(lib_handle, x) x = (x##_)GetProcAddress(lib_handle, #x); if (!x) goto err; +/* Avoid direct function-pointer cast from FARPROC to typed callback pointer. + Using memcpy keeps this warning-free regardless of the compiler and compiler settings. */ +#define RESOLVE(lib_handle, x) do { \ + FARPROC proc_addr = GetProcAddress(lib_handle, #x); \ + if (!proc_addr) goto err; \ + memcpy(&x, &proc_addr, sizeof(x)); \ +} while (0) RESOLVE(hid_lib_handle, HidD_GetHidGuid); RESOLVE(hid_lib_handle, HidD_GetAttributes); @@ -167,9 +169,6 @@ static int lookup_functions() RESOLVE(cfgmgr32_lib_handle, CM_Get_Device_Interface_ListW); #undef RESOLVE -#if defined(__GNUC__) -# pragma GCC diagnostic pop -#endif return 0; From 5787d75065e84b712377cede8f3b4423cad4781a Mon Sep 17 00:00:00 2001 From: Ihor Dutchak Date: Sun, 1 Mar 2026 12:05:48 +0200 Subject: [PATCH 2/2] Fix archlinux CI build --- .github/workflows/builds.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 0ff09a4b..83ebe190 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -439,7 +439,7 @@ jobs: - name: Install dependencies run: | pacman -Sy - pacman -S --noconfirm glibc lib32-glibc gcc pkg-config autoconf automake libtool libusb libudev0 cmake make + pacman -S --noconfirm glibc lib32-glibc gcc pkg-config autoconf automake libtool libusb cmake make - name: Configure CMake run: | rm -rf build install