Skip to content

Commit 75dfb56

Browse files
authored
Clarify documentation for CommandLine.unsafeArgv re: the trailing nil. (swiftlang#58484) (swiftlang#63413)
1 parent 92652c6 commit 75dfb56

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

stdlib/public/core/CommandLine.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,13 @@ public enum CommandLine {
4242
return _argc
4343
}
4444

45-
/// Access to the raw argv value from C. Accessing the argument vector
46-
/// through this pointer is unsafe.
45+
/// Access to the raw argv value from C.
46+
///
47+
/// The value of this property is a `nil`-terminated C array. Including the
48+
/// trailing `nil`, there are ``argc`` `+ 1` elements in the array.
49+
///
50+
/// - Note: Accessing the argument vector through this pointer is unsafe.
51+
/// Where possible, use ``arguments`` instead.
4752
public static var unsafeArgv:
4853
UnsafeMutablePointer<UnsafeMutablePointer<Int8>?> {
4954
return _unsafeArgv

0 commit comments

Comments
 (0)