From 2d17e64367658f5780a95ad74fe5134eec1cf3ac Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Sun, 12 Jan 2025 20:32:23 +0100 Subject: [PATCH] Fix `-Wpointer-type-mismatch` warning `GetProcAddress()` returns a `FARPROC` (aka. `long long (*)()`) which is not compatible with `void *` per the specs. However, on Windows they are, so we silence the warning with a cast. --- ext/ffi/ffi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/ffi/ffi.c b/ext/ffi/ffi.c index 99abce5378521..c8e0035b3ac91 100644 --- a/ext/ffi/ffi.c +++ b/ext/ffi/ffi.c @@ -3052,7 +3052,7 @@ static void *dlsym_loaded(char *symbol) return addr; } # undef DL_FETCH_SYMBOL -# define DL_FETCH_SYMBOL(h, s) (h == NULL ? dlsym_loaded(s) : GetProcAddress(h, s)) +# define DL_FETCH_SYMBOL(h, s) (h == NULL ? dlsym_loaded(s) : (void*) GetProcAddress(h, s)) #endif ZEND_METHOD(FFI, cdef) /* {{{ */