VTK::CommonCoreCxx-TestLogger failure under UBSan
At compile time:
Common/Core/vtkLogger.cxx:251:28: warning: cast from 'vtkLogger::LogHandlerCallbackT' (aka 'void (*)(void *, const vtkLogger::Message &)') to 'vtkloguru::log_handler_t' (aka 'void (*)(void *, const vtkloguru::Message &)') converts to incompatible function type [-Wcast-function-type]
loguru::add_callback(id, reinterpret_cast<loguru::log_handler_t>(callback), user_data,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
and at runtime with UBSan:
ThirdParty/loguru/vtkloguru/loguru.cpp:1284:5: runtime error: call to function (anonymous namespace)::log_handler(void*, vtkLogger::Message const&) through pointer to incorrect function type 'void (*)(void *, const vtkloguru::Message &)'
As is often the case, reinterpret_cast
is something of a foot-gun... but I'm not sure how to fix this...
@ben.boeckel who knows loguru?