-
Notifications
You must be signed in to change notification settings - Fork 163
Open
Labels
Description
A -Wcast-function-type-mismatch
warning is generated when compiling examples using Clang on Windows:
.../xed/wkit/examples/xed-util-disas-pecoff.cpp:87:8: error: cast from 'FARPROC' (aka 'long long (*)()') to 'fptr_t' (aka 'int (*)(void *)') converts to incompatible function type [-Werror,-Wcast-function-type-mismatch]
87 | p = (fptr_t) GetProcAddress(
| ^~~~~~~~~~~~~~~~~~~~~~~~
88 | GetModuleHandle(TEXT("kernel32.dll")),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
89 | function_name);
| ~~~~~~~~~~~~~~
1 error generated.
This causes a compiler error due to -Werror
being set by default. I've opened a PR with the appropriate fix which adds a void pointer cast before casting to fptr_t
which effectively ignores this warning.
see #351