Skip to content

Conversation

@ajkhoury
Copy link

This fixes a -Wcast-function-type-mismatch warning that 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. This commit adds a void pointer cast before casting to fptr_t which effectively ignores this warning.

Signed-off-by: Aidan Khoury <aidan@aktech.ai>
@kkhalail kkhalail marked this pull request as draft November 4, 2025 13:53
@marjevan marjevan added acknowledged upcoming release A fix/support will be available with the upcoming external release labels Nov 4, 2025
@sdeadmin sdeadmin closed this in 722cd23 Nov 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

acknowledged upcoming release A fix/support will be available with the upcoming external release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants