Skip to content

Commit

Permalink
Merge pull request swiftlang#74642 from kubamracek/embedded-fix-warnings
Browse files Browse the repository at this point in the history
[embedded] Fix 3 compilation warnings in embedded stdlib
  • Loading branch information
kubamracek committed Jun 22, 2024
2 parents 35b2b71 + 1d9cebe commit 7d8a62a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stdlib/public/core/EmbeddedPrint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public func print(_ string: StaticString, terminator: StaticString = "\n") {
@_disfavoredOverload
public func print(_ string: String, terminator: StaticString = "\n") {
var string = string
_ = string.withUTF8 { buf in
string.withUTF8 { buf in
for c in buf {
putchar(CInt(c))
}
Expand All @@ -51,7 +51,7 @@ public func print(_ string: String, terminator: StaticString = "\n") {
@_disfavoredOverload
public func print(_ object: some CustomStringConvertible, terminator: StaticString = "\n") {
var string = object.description
_ = string.withUTF8 { buf in
string.withUTF8 { buf in
for c in buf {
putchar(CInt(c))
}
Expand Down
1 change: 1 addition & 0 deletions stdlib/public/core/Optional.swift
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ extension Optional: CustomDebugStringConvertible {
#if !$Embedded
debugPrint(value, terminator: "", to: &result)
#else
_ = value
"(cannot print value in embedded Swift)".write(to: &result)
#endif
result += ")"
Expand Down

0 comments on commit 7d8a62a

Please sign in to comment.