From e8ceaabb87006ab1378e38b91cc516ca0197a1ff Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 7 Nov 2017 02:33:25 +0100 Subject: [PATCH] Avoid gcc -Wunused-function warnings in wxEvtHandler unit test The warnings are justified as the functions defined by the event table macros are indeed not used here because we only write them to test that they compile, but not useful, so suppress them. --- tests/events/evthandler.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/events/evthandler.cpp b/tests/events/evthandler.cpp index ac8b59bd0c..b25f4f65aa 100644 --- a/tests/events/evthandler.cpp +++ b/tests/events/evthandler.cpp @@ -127,6 +127,11 @@ private: wxDECLARE_EVENT_TABLE(); }; +// Avoid gcc warning about some of the functions defined by the expansion of +// the event table macros being unused: they are indeed unused, but we still +// want to have them to check that they compile. +wxGCC_WARNING_SUPPRESS(unused-function) + wxBEGIN_EVENT_TABLE(MyClassWithEventTable, wxEvtHandler) EVT_IDLE(MyClassWithEventTable::OnIdle) @@ -138,6 +143,8 @@ wxBEGIN_EVENT_TABLE(MyClassWithEventTable, wxEvtHandler) //EVT_IDLE(MyClassWithEventTable::OnAnotherEvent) wxEND_EVENT_TABLE() +wxGCC_WARNING_RESTORE(unused-function) + } // anonymous namespace