From b6d082a7a6167f0a4094c78991abbf7e9d383acc Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 4 Jul 2023 01:43:55 +0200 Subject: [PATCH] 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. --- tests/events/evthandler.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/events/evthandler.cpp b/tests/events/evthandler.cpp index f7c5adc256..e0c60d4e36 100644 --- a/tests/events/evthandler.cpp +++ b/tests/events/evthandler.cpp @@ -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);