<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/getVaList(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:s9getVaListys03CVaC7PointerVSays7CVarArg_pGF"
  },
  "title" : "getVaList(_:)"
}
-->

# getVaList(_:)

Returns a `CVaListPointer` that is backed by autoreleased storage, built
from the given array of arguments.

```
func getVaList(_ args: [any CVarArg]) -> CVaListPointer
```

## Parameters

`args`

An array of arguments to convert to a C `va_list`
pointer.

## Return Value

A pointer that can be used with C functions that take a
`va_list` argument.

## Discussion

You should prefer `withVaList(_:_:)` instead of this function. In some
uses, such as in a `class` initializer, you may find that the language
rules do not allow you to use `withVaList(_:_:)` as intended.

If you need to pass an optional pointer as a `CVarArg` argument, use the
`Int(bitPattern:)` initializer to interpret the optional pointer as an
`Int` value, which has the same C variadic calling conventions as a pointer
on all supported platforms.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)