From e854a2e0dc2b3896f427fcb54361d11a85161648 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 4 Oct 2026 15:00:44 +0200 Subject: [PATCH 1/3] Switch macOS 14 CI jobs to macOS 15 macOS 14 runners will be retired by GitHub soon. --- .github/workflows/ci_cmake.yml | 8 ++++---- .github/workflows/ci_mac.yml | 6 +++--- .github/workflows/ci_mac_xcode.yml | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci_cmake.yml b/.github/workflows/ci_cmake.yml index 8de8d9158a..68abf4933d 100644 --- a/.github/workflows/ci_cmake.yml +++ b/.github/workflows/ci_cmake.yml @@ -61,8 +61,8 @@ jobs: cmake_generator: Unix Makefiles cmake_samples: ALL cmake_build_toolkit: gtk3 - - name: macOS 14 wxOSX Xcode - runner: macos-14 + - name: macOS 15 wxOSX Xcode + runner: macos-15 cmake_generator: Xcode cmake_defines: -DCMAKE_OSX_DEPLOYMENT_TARGET="10.13" cmake_build_toolkit: osx_cocoa @@ -79,8 +79,8 @@ jobs: cmake_samples: SOME cmake_tests: OFF cmake_build_toolkit: gtk3 - - name: macOS 14 wxIOS - runner: macos-14 + - name: macOS 15 wxIOS + runner: macos-15 cmake_generator: Xcode cmake_defines: -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_FIND_ROOT_PATH=/usr/local -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=NO cmake_samples: OFF diff --git a/.github/workflows/ci_mac.yml b/.github/workflows/ci_mac.yml index bede3d1047..19c73245da 100644 --- a/.github/workflows/ci_mac.yml +++ b/.github/workflows/ci_mac.yml @@ -88,15 +88,15 @@ jobs: configure_flags: --enable-std_string_conv_in_wxstring --disable-compat32 --disable-sys-libs use_asan: true - name: wxMac Intel C++17 - runner: macos-14 + runner: macos-15 arch: x86_64 configure_flags: --with-cxx=17 --with-macosx-version-min=10.12 - name: wxMac Universal C++14 - runner: macos-14 + runner: macos-15 arch: arm64 configure_flags: --with-cxx=14 --enable-universal_binary=arm64,x86_64 --disable-shared --disable-sys-libs --disable-debug --enable-optimise - name: wxiOS - runner: macos-14 + runner: macos-15 arch: x86_64 configure_flags: --with-osx_iphone --enable-monolithic --disable-sys-libs --host=i686-apple-darwin_sim --build=x86_64-apple-darwin17.7.0 configure_env: PKG_CONFIG_LIBDIR=/dev/null diff --git a/.github/workflows/ci_mac_xcode.yml b/.github/workflows/ci_mac_xcode.yml index f5b7661e01..383e93a6f5 100644 --- a/.github/workflows/ci_mac_xcode.yml +++ b/.github/workflows/ci_mac_xcode.yml @@ -90,7 +90,7 @@ jobs: configuration: 'Release' project: samples/minimal/minimal_cocoa.xcodeproj - name: iOS static Debug - runner: macos-14 + runner: macos-15 scheme: 'static' destination: 'generic/platform=iOS' arch: x86_64 From af203498f5e64b82b18e41420e817a6b04b7a97f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 4 Oct 2026 16:48:35 +0200 Subject: [PATCH 2/3] Fix signature of functions used as CFRunLoopObserverCallBack These functions must take "activity" parameter as "unsigned long" and not "int" to make their type compatible with CFRunLoopObserverCallBack which uses CFRunLoopActivity that is defined as "unsigned long". This fixes warnings with Apple clang 17, used in GitHub Actions macOS 15 images, which apparently enables -Wcast-function-type-mismatch by default. And it's the right thing to do, anyhow. --- include/wx/osx/core/evtloop.h | 10 ++++++---- src/osx/core/evtloop_cf.cpp | 12 ++++++------ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/include/wx/osx/core/evtloop.h b/include/wx/osx/core/evtloop.h index 5735edc762..d1a7b7aa57 100644 --- a/include/wx/osx/core/evtloop.h +++ b/include/wx/osx/core/evtloop.h @@ -59,14 +59,16 @@ protected: virtual void DoYieldFor(long eventsToProcess) override; - void CommonModeObserverCallBack(CFRunLoopObserverRef observer, int activity); - void DefaultModeObserverCallBack(CFRunLoopObserverRef observer, int activity); + void CommonModeObserverCallBack(CFRunLoopObserverRef observer, unsigned long activity); + void DefaultModeObserverCallBack(CFRunLoopObserverRef observer, unsigned long activity); // set to false to avoid idling at unexpected moments - eg when having native message boxes void SetProcessIdleEvents(bool process) { m_processIdleEvents = process; } - static void OSXCommonModeObserverCallBack(CFRunLoopObserverRef observer, int activity, void *info); - static void OSXDefaultModeObserverCallBack(CFRunLoopObserverRef observer, int activity, void *info); + // Those are used as CFRunLoopObserverCallBack and so must have the same + // signature, in particular use "unsigned long" for CFRunLoopActivity. + static void OSXCommonModeObserverCallBack(CFRunLoopObserverRef observer, unsigned long activity, void *info); + static void OSXDefaultModeObserverCallBack(CFRunLoopObserverRef observer, unsigned long activity, void *info); // get the currently executing CFRunLoop virtual CFRunLoopRef CFGetCurrentRunLoop() const; diff --git a/src/osx/core/evtloop_cf.cpp b/src/osx/core/evtloop_cf.cpp index 386722a9e4..fb55269734 100644 --- a/src/osx/core/evtloop_cf.cpp +++ b/src/osx/core/evtloop_cf.cpp @@ -69,21 +69,21 @@ wxCFEventLoopSource::~wxCFEventLoopSource() #endif // wxUSE_EVENTLOOP_SOURCE -void wxCFEventLoop::OSXCommonModeObserverCallBack(CFRunLoopObserverRef observer, int activity, void *info) +void wxCFEventLoop::OSXCommonModeObserverCallBack(CFRunLoopObserverRef observer, unsigned long activity, void *info) { wxCFEventLoop * eventloop = static_cast(info); if ( eventloop && eventloop->IsRunning() ) eventloop->CommonModeObserverCallBack(observer, activity); } -void wxCFEventLoop::OSXDefaultModeObserverCallBack(CFRunLoopObserverRef observer, int activity, void *info) +void wxCFEventLoop::OSXDefaultModeObserverCallBack(CFRunLoopObserverRef observer, unsigned long activity, void *info) { wxCFEventLoop * eventloop = static_cast(info); if ( eventloop && eventloop->IsRunning() ) eventloop->DefaultModeObserverCallBack(observer, activity); } -void wxCFEventLoop::CommonModeObserverCallBack(CFRunLoopObserverRef WXUNUSED(observer), int activity) +void wxCFEventLoop::CommonModeObserverCallBack(CFRunLoopObserverRef WXUNUSED(observer), unsigned long activity) { if ( activity & kCFRunLoopBeforeTimers ) { @@ -116,7 +116,7 @@ void wxCFEventLoop::CommonModeObserverCallBack(CFRunLoopObserverRef WXUNUSED(obs void wxCFEventLoop::DefaultModeObserverCallBack(CFRunLoopObserverRef WXUNUSED(observer), - int WXUNUSED(activity)) + unsigned long WXUNUSED(activity)) { /* if ( activity & kCFRunLoopBeforeTimers ) @@ -145,11 +145,11 @@ wxCFEventLoop::wxCFEventLoop() bzero( &ctxt, sizeof(ctxt) ); ctxt.info = this; m_commonModeRunLoopObserver = CFRunLoopObserverCreate( kCFAllocatorDefault, kCFRunLoopBeforeTimers | kCFRunLoopBeforeWaiting , true /* repeats */, 0, - (CFRunLoopObserverCallBack) wxCFEventLoop::OSXCommonModeObserverCallBack, &ctxt ); + wxCFEventLoop::OSXCommonModeObserverCallBack, &ctxt ); CFRunLoopAddObserver(m_runLoop, m_commonModeRunLoopObserver, kCFRunLoopCommonModes); m_defaultModeRunLoopObserver = CFRunLoopObserverCreate( kCFAllocatorDefault, kCFRunLoopBeforeTimers | kCFRunLoopBeforeWaiting , true /* repeats */, 0, - (CFRunLoopObserverCallBack) wxCFEventLoop::OSXDefaultModeObserverCallBack, &ctxt ); + wxCFEventLoop::OSXDefaultModeObserverCallBack, &ctxt ); CFRunLoopAddObserver(m_runLoop, m_defaultModeRunLoopObserver, kCFRunLoopDefaultMode); } From 4f9ff04ccc72b023b4db4c1e247e7fd60e27e3a4 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 4 Oct 2026 19:26:41 +0200 Subject: [PATCH 3/3] Generalize wxGCC_WARNING_SUPPRESS_CAST_FUNCTION_TYPE to clang too Apple clang now enables the warning suppressed by this macro by default, so it becomes important to suppress it for this compiler as well and not just gcc. Rename the macro to remove "GCC" prefix which doesn't make sense any more now that this macro is not only for gcc. This avoids warnings in the test suite when building in macOS 15 GitHub Actions image using newer Apple clang. --- include/wx/defs.h | 28 +++++++++++++++++----------- include/wx/event.h | 6 ++---- include/wx/glcanvas.h | 4 ++-- src/gtk/evtloop.cpp | 4 ++-- tests/events/evthandler.cpp | 4 ++-- 5 files changed, 25 insertions(+), 21 deletions(-) diff --git a/include/wx/defs.h b/include/wx/defs.h index 694c28cbe8..45f455c88a 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -685,17 +685,6 @@ int wxSsize(const C& c) # define wxGCC_ONLY_WARNING_RESTORE(x) #endif -/* Specific macros for -Wcast-function-type warning new in gcc 8. */ -#if wxCHECK_GCC_VERSION(8, 0) - #define wxGCC_WARNING_SUPPRESS_CAST_FUNCTION_TYPE() \ - wxGCC_WARNING_SUPPRESS(cast-function-type) - #define wxGCC_WARNING_RESTORE_CAST_FUNCTION_TYPE() \ - wxGCC_WARNING_RESTORE(cast-function-type) -#else - #define wxGCC_WARNING_SUPPRESS_CAST_FUNCTION_TYPE() - #define wxGCC_WARNING_RESTORE_CAST_FUNCTION_TYPE() -#endif - /* Macros to suppress and restore clang warning only when it is valid. @@ -719,6 +708,23 @@ int wxSsize(const C& c) # define wxCLANG_WARNING_RESTORE(x) #endif +/* + Specific macros for -Wcast-function-type warning new in gcc 8 and also + supported by clang, which enables its -Wcast-function-type-mismatch subset + by default in some versions (e.g. Apple clang 17). + */ +#if wxCHECK_GCC_VERSION(8, 0) + #define wxWARNING_SUPPRESS_CAST_FUNCTION_TYPE() \ + wxGCC_WARNING_SUPPRESS(cast-function-type) + #define wxWARNING_RESTORE_CAST_FUNCTION_TYPE() \ + wxGCC_WARNING_RESTORE(cast-function-type) +#else + #define wxWARNING_SUPPRESS_CAST_FUNCTION_TYPE() \ + wxCLANG_WARNING_SUPPRESS(cast-function-type) + #define wxWARNING_RESTORE_CAST_FUNCTION_TYPE() \ + wxCLANG_WARNING_RESTORE(cast-function-type) +#endif + /* Macros to suppress and restore MSVC warnings, taking the warning number. diff --git a/include/wx/event.h b/include/wx/event.h index afea29e016..cc1e64f549 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -139,13 +139,11 @@ inline wxEventFunction wxEventFunctionCast(void (wxEvtHandler::*func)(T&)) // them locally to avoid generating hundreds of them when compiling any // code using event table macros. - wxGCC_WARNING_SUPPRESS_CAST_FUNCTION_TYPE() - wxCLANG_WARNING_SUPPRESS(cast-function-type) + wxWARNING_SUPPRESS_CAST_FUNCTION_TYPE() return reinterpret_cast(func); - wxCLANG_WARNING_RESTORE(cast-function-type) - wxGCC_WARNING_RESTORE_CAST_FUNCTION_TYPE() + wxWARNING_RESTORE_CAST_FUNCTION_TYPE() } // In good old pre-C++17 times we could just static_cast the event handler, diff --git a/include/wx/glcanvas.h b/include/wx/glcanvas.h index 0d28531966..d5bfa86140 100644 --- a/include/wx/glcanvas.h +++ b/include/wx/glcanvas.h @@ -209,11 +209,11 @@ public: template static T GetProcAddress(const wxString& name) { - wxGCC_WARNING_SUPPRESS_CAST_FUNCTION_TYPE() + wxWARNING_SUPPRESS_CAST_FUNCTION_TYPE() return reinterpret_cast(GetProcAddress(name)); - wxGCC_WARNING_RESTORE_CAST_FUNCTION_TYPE() + wxWARNING_RESTORE_CAST_FUNCTION_TYPE() } protected: diff --git a/src/gtk/evtloop.cpp b/src/gtk/evtloop.cpp index a52a3160f4..c55e38582f 100644 --- a/src/gtk/evtloop.cpp +++ b/src/gtk/evtloop.cpp @@ -403,9 +403,9 @@ void wxGUIEventLoop::DoYieldFor(long eventsToProcess) while (Pending()) // avoid false positives from our idle source gtk_main_iteration(); - wxGCC_WARNING_SUPPRESS_CAST_FUNCTION_TYPE() + wxWARNING_SUPPRESS_CAST_FUNCTION_TYPE() gdk_event_handler_set ((GdkEventFunc)gtk_main_do_event, nullptr, nullptr); - wxGCC_WARNING_RESTORE_CAST_FUNCTION_TYPE() + wxWARNING_RESTORE_CAST_FUNCTION_TYPE() wxEventLoopBase::DoYieldFor(eventsToProcess); diff --git a/tests/events/evthandler.cpp b/tests/events/evthandler.cpp index e0c60d4e36..fe676a232c 100644 --- a/tests/events/evthandler.cpp +++ b/tests/events/evthandler.cpp @@ -168,10 +168,10 @@ TEST_CASE("Event::BuiltinConnect", "[event][connect]") // 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() + wxWARNING_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() + wxWARNING_RESTORE_CAST_FUNCTION_TYPE() handler.Bind(wxEVT_IDLE, GlobalOnIdle); handler.Unbind(wxEVT_IDLE, GlobalOnIdle);