On 18.09.2024 14:06, Martin Storsjö wrote:
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");
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
That warning seems very impractical in code dealing with GetProcAddress.
In Wine, we usually just cast it to (void *), but I recall that it was
problematic for mingw-w64-crt for some reason too. Maybe we could just
disable that warning in the configure script?
Thanks,
Jacek
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public