[Lldb-commits] [lldb] c7605bf - [lldb] Fix cast-function-type-mismatch warning in Host.mm (NFC)
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Thu Nov 14 11:14:59 PST 2024
Author: Jonas Devlieghere
Date: 2024-11-14T11:12:58-08:00
New Revision: c7605bfd4eaf1b0fe46fa91bd0e3f7aa17585d89
URL: https://github.com/llvm/llvm-project/commit/c7605bfd4eaf1b0fe46fa91bd0e3f7aa17585d89
DIFF: https://github.com/llvm/llvm-project/commit/c7605bfd4eaf1b0fe46fa91bd0e3f7aa17585d89.diff
LOG: [lldb] Fix cast-function-type-mismatch warning in Host.mm (NFC)
Fixes warning: cast from 'void (*)(xpc_object_t _Nonnull)' (aka 'void
(*)(NSObject<OS_xpc_object> * _Nonnull)') to 'xpc_finalizer_t' (aka
'void (*)(void * _Nullable)') converts to incompatible function type
[-Wcast-function-type-mismatch]
Added:
Modified:
lldb/source/Host/macosx/objcxx/Host.mm
Removed:
################################################################################
diff --git a/lldb/source/Host/macosx/objcxx/Host.mm b/lldb/source/Host/macosx/objcxx/Host.mm
index fe63cc16c64990..a99ffbc3a3faca 100644
--- a/lldb/source/Host/macosx/objcxx/Host.mm
+++ b/lldb/source/Host/macosx/objcxx/Host.mm
@@ -891,6 +891,10 @@ static short GetPosixspawnFlags(const ProcessLaunchInfo &launch_info) {
return flags;
}
+static void finalize_xpc(void *xpc_object) {
+ xpc_release((xpc_object_t)xpc_object);
+}
+
static Status LaunchProcessXPC(const char *exe_path,
ProcessLaunchInfo &launch_info,
lldb::pid_t &pid) {
@@ -956,7 +960,7 @@ static Status LaunchProcessXPC(const char *exe_path,
}
});
- xpc_connection_set_finalizer_f(conn, xpc_finalizer_t(xpc_release));
+ xpc_connection_set_finalizer_f(conn, finalize_xpc);
xpc_connection_resume(conn);
xpc_object_t message = xpc_dictionary_create(nil, nil, 0);
More information about the lldb-commits
mailing list