On Monday 05 August 2024 17:26:47 LIU Hao wrote:
> 在 2024-08-05 01:40, Pali Rohár 写道:
> > It looks like that casting whole function pointer to LPVOID type prior
> > casting to FARPROC mutes this warning.
> > 
> > Now I remember that in past I have already used casting return value
> > from GetProcAddress() to LPVOID and after that to the correct function
> > pointer type which muted gcc warnings.
> 
> No, cast to `INT_PTR` instead. Casting between function pointers and object
> pointers is undefined behavior in C; but it's required by POSIX, and is
> conditionally supported in C++.

Ok. And casting between a number (intptr_t) and function pointer is fine?


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

Reply via email to