Skip to content

Commit c7605bf

Browse files
committed
[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]
1 parent c923ac0 commit c7605bf

File tree

1 file changed

+5
-1
lines changed
  • lldb/source/Host/macosx/objcxx

1 file changed

+5
-1
lines changed

lldb/source/Host/macosx/objcxx/Host.mm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,6 +891,10 @@ static short GetPosixspawnFlags(const ProcessLaunchInfo &launch_info) {
891891
return flags;
892892
}
893893

894+
static void finalize_xpc(void *xpc_object) {
895+
xpc_release((xpc_object_t)xpc_object);
896+
}
897+
894898
static Status LaunchProcessXPC(const char *exe_path,
895899
ProcessLaunchInfo &launch_info,
896900
lldb::pid_t &pid) {
@@ -956,7 +960,7 @@ static Status LaunchProcessXPC(const char *exe_path,
956960
}
957961
});
958962

959-
xpc_connection_set_finalizer_f(conn, xpc_finalizer_t(xpc_release));
963+
xpc_connection_set_finalizer_f(conn, finalize_xpc);
960964
xpc_connection_resume(conn);
961965
xpc_object_t message = xpc_dictionary_create(nil, nil, 0);
962966

0 commit comments

Comments
 (0)