On Wed, 18 Sep 2024, LIU Hao wrote:

在 2024-09-18 20:36, Jacek Caban 写道:
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?

It's required by POSIX, but casting between a function pointer and an object pointer can produce a warning with `-pedantic`.

It looks like GCC warns in C and Clang warns in C++. /facepalm

Hmm, can you give a godbolt example or similar, for where the compilers diverge about warnings here?

With Clang, I don't seem to be able to get any warnings for either casts via (void(*)(void)) or (void*), with either C or C++, with -Wall -Wextra -pedantic.

// Martin

_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to