On 18.09.2024 16:16, LIU Hao wrote:
Maybe, but in practice it's pretty well defined behavior.
Yes; my suggestion about casting via `intptr_t` also just happens to
work in practice.
So far there are two compilers which are known to warn sometimes about
conversion between a function pointer and `void*`, but no compiler is
known to warn about conversion between a function pointer and
`intptr_t`, so the latter should be a win, isn't it?
The nice thing about using (void *) cast is that you need just one cast.
With intptr_t, you need to cast it additionally to the desired type,
while with void* the second cast may be implicit. (Anyway, probably not
a big deal).
Thanks,
Jacek
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public