在 2019/12/17 20:56, Vincent Lefevre 写道: > On 2019-12-12 11:53:05 +0100, Josef Wolf wrote: >> Thanks for the help, Liu! >> >> This silenced the warning. > > The goal should not be to silence warnings, but to write portable > code. If you find a way to silence a warning, only to silence a > warning, this is useless. You'd better disable warnings. > > Here your code is still non-portable, perhaps *more* non-portable, > as only conversions between intptr_t and void * are guaranteed to > work. Moreover, the intptr_t type is optional. > POSIX requires casting between `void*` and pointer-to-function to preserve values in the specification of `dlsym()`. C++ says it is conditionally supported. I don't see portability issues. Non-POSIX systems (other than Windows) died decades ago. -- Best regards, LH_Mouse