Suppress warning in tests checking legacy Connect()

This code can't be modified as it tests for compatibility with the
existing code of this form, so just disable the warnings it now triggers
with -Wextra.
This commit is contained in:
Vadim Zeitlin 2023-07-04 01:43:55 +02:00
parent 9952af8e93
commit b6d082a7a6

View file

@ -165,10 +165,13 @@ TEST_CASE("Event::BuiltinConnect", "[event][connect]")
handler.Connect(wxEVT_IDLE, wxIdleEventHandler(MyHandler::OnIdle), nullptr, &handler);
handler.Disconnect(wxEVT_IDLE, wxIdleEventHandler(MyHandler::OnIdle), nullptr, &handler);
// using casts like this is even uglier than using wxIdleEventHandler but
// it should still continue to work for compatibility
// using casts like this is even uglier than using wxIdleEventHandler and
// results in warnings with gcc, but it should still continue to work for
// compatibility
wxGCC_WARNING_SUPPRESS_CAST_FUNCTION_TYPE()
handler.Connect(wxEVT_IDLE, (wxObjectEventFunction)(wxEventFunction)&MyHandler::OnIdle);
handler.Disconnect(wxEVT_IDLE, (wxObjectEventFunction)(wxEventFunction)&MyHandler::OnIdle);
wxGCC_WARNING_RESTORE_CAST_FUNCTION_TYPE()
handler.Bind(wxEVT_IDLE, GlobalOnIdle);
handler.Unbind(wxEVT_IDLE, GlobalOnIdle);