crt: Use (void*) casts to silence warnings about function pointer casts
Modern GCC and Clang warn for these casts, with warnings like these:
../secapi/_chsize_s.c:20:6: warning: cast from 'FARPROC' (aka 'long long (*)()') to 'errno_t ((*))(int, long long) __attribute__((cdecl))' (aka 'int (*)(int, lo
ng long)') converts to incompatible function type [-Wcast-function-type-mismatch]
20 | f = (errno_t __cdecl (*)(int, long long))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21 | GetProcAddress (__mingw_get_msvcrt_handle (), "_chsize_s");
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
By casting to (void*) instead, we can let the compiler do the second
cast to the target function type implicitly, and also silencing these
warnings.
Signed-off-by: Martin Storsjö <martin@martin.st>
diff --git a/mingw-w64-crt/secapi/_localtime64_s.c b/mingw-w64-crt/secapi/_localtime64_s.c
index bff0868..58dbb11 100644
--- a/mingw-w64-crt/secapi/_localtime64_s.c
+++ b/mingw-w64-crt/secapi/_localtime64_s.c
@@ -17,7 +17,7 @@
if (f == _stub)
{
- f = (errno_t __cdecl (*)(struct tm *, const __time64_t *))
+ f = (void*)
GetProcAddress (__mingw_get_msvcrt_handle (), "_localtime64_s");
if (!f)
f = _int_localtime64_s;