<!--
{
  "availability" : [
    "SwiftPM: 6.2.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PackageDescription",
  "identifier" : "/documentation/PackageDescription/SwiftSetting/strictMemorySafety(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "PackageDescription"
    ],
    "preciseIdentifier" : "s:18PackageDescription12SwiftSettingV18strictMemorySafetyyAcA05BuildD9ConditionVSgFZ"
  },
  "title" : "strictMemorySafety(_:)"
}
-->

# strictMemorySafety(_:)

Enable strict memory safety checking.

```
static func strictMemorySafety(_ condition: BuildSettingCondition? = nil) -> SwiftSetting
```

## Parameters

`condition`

A condition that restricts the application of the build
setting.

## Discussion

Strict memory safety checking is an opt-in compiler feature that
identifies any uses of language constructs or APIs that break
memory safety. Issues are reported as warnings and can generally
be suppressed by adding annotations (such as `@unsafe` and `unsafe`)
that acknowledge the presence of unsafe code, making it easier to
review and audit at a later time.

> Since: First available in PackageDescription 6.2.

---

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)