From: Michael An Date: Thu, 21 Jun 2018 01:05:27 +0000 (-0400) Subject: Fix GCC 8 cast warnings X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=06a853eb9c5173c30b31e75d0828c29dd65ebca4;hp=06a853eb9c5173c30b31e75d0828c29dd65ebca4 Fix GCC 8 cast warnings Silences the following warnings when compiling with GCC 8. The fix is to use an intermediate pointer to anonymous function: ``` misc.cpp: In function 'int WinProcGroup::get_group(size_t)': misc.cpp:241:77: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'fun1_t' {aka 'bool (*)(_LOGICAL_PROCESSOR_RELATIONSHIP, _SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX*, long unsigned int*)'} [-Wcast-function-type] auto fun1 = (fun1_t)GetProcAddress(k32, "GetLogicalProcessorInformationEx"); ^ misc.cpp: In function 'void WinProcGroup::bindThisThread(size_t)': misc.cpp:309:71: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'fun2_t' {aka 'bool (*)(short unsigned int, _GROUP_AFFINITY*)'} [-Wcast-function-type] auto fun2 = (fun2_t)GetProcAddress(k32, "GetNumaNodeProcessorMaskEx"); ^ misc.cpp:310:67: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'fun3_t' {aka 'bool (*)(void*, const _GROUP_AFFINITY*, _GROUP_AFFINITY*)'} [-Wcast-function-type] auto fun3 = (fun3_t)GetProcAddress(k32, "SetThreadGroupAffinity"); ^ ``` No functional change. ---