From f8fb99320ab923c392e91ae38f80016a31241210 Mon Sep 17 00:00:00 2001 From: Allan Shortlidge Date: Sun, 18 May 2025 10:34:54 -0700 Subject: [PATCH] Embedded: Suppress spurious unused result warnings. The results of `swift_retain(object:)` and `swift_bridgeObjectRetain(object:)` should be discardable since it's typcial to not need the pointer returned from these calls. Suppresses unused result warnings that were generated previously. --- stdlib/public/core/EmbeddedRuntime.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stdlib/public/core/EmbeddedRuntime.swift b/stdlib/public/core/EmbeddedRuntime.swift index ad40dd724e5cb..94ea675199e3d 100644 --- a/stdlib/public/core/EmbeddedRuntime.swift +++ b/stdlib/public/core/EmbeddedRuntime.swift @@ -316,6 +316,7 @@ func swift_isUniquelyReferenced_nonNull_native(object: UnsafeMutablePointer Builtin.RawPointer { if !isValidPointerForNativeRetain(object: object) { return object } @@ -344,6 +345,7 @@ func swift_retain_n_(object: UnsafeMutablePointer, n: UInt32) -> Uns } @_cdecl("swift_bridgeObjectRetain") +@discardableResult public func swift_bridgeObjectRetain(object: Builtin.RawPointer) -> Builtin.RawPointer { return swift_bridgeObjectRetain_n(object: object, n: 1) }