<!--
{
  "documentType" : "article",
  "framework" : "Xcode",
  "identifier" : "/documentation/Xcode/reaching-of-unreachable-point",
  "metadataVersion" : "0.1.0",
  "role" : "article",
  "title" : "Reaching of unreachable point"
}
-->

# Reaching of unreachable point

Detects when a program reaches an unreachable point.

## Overview

Use this check to detect when control flow reaches an unreachable point in a program you create using  `__builtin_unreachable`, which may cause abrupt program termination. Available in Xcode 9 and later.

### Executing unreachable code in C

If the `switch` statement fails to handle a value that a function returns, the program reaches  `__builtin_unreachable()`.

```occ
switch (value_returning_function()) {
case ...:                  // Warning: if the cases are not exhaustive
default:                   // __builtin_unreachable may be reached
    __builtin_unreachable();
}
```

#### Solution

Ensure that `switch` statements and other control flow statements are exhaustive.

---

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)