---
title: Reaching of unreachable point
framework: xcode
role: article
role_heading: Article
path: xcode/reaching-of-unreachable-point
---

# Reaching of unreachable point

Detects when a program reaches an unreachable point.

## Overview

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(). 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.

## See Also

### Undefined Behavior Sanitizer

- [Misaligned pointer](xcode/misaligned-pointer.md)
- [Invalid Boolean value](xcode/invalid-boolean.md)
- [Out-of-bounds array access](xcode/out-of-bounds-array-access.md)
- [Invalid enumeration value](xcode/invalid-enumeration-value.md)
- [Dynamic type violation](xcode/dynamic-type-violation.md)
- [Invalid float cast](xcode/invalid-float-cast.md)
- [Division by zero](xcode/division-by-zero.md)
- [Nonnull argument violation](xcode/nonnull-argument-violation.md)
- [Nonnull return value violation](xcode/nonnull-return-value-violation.md)
- [Nonnull variable assignment violation](xcode/nonnull-variable-assignment-violation.md)
- [Null reference creation and null pointer dereference](xcode/null-reference-creation-and-null-pointer-dereference.md)
- [Invalid object size](xcode/invalid-object-size.md)
- [Invalid shift](xcode/invalid-shift.md)
- [Integer overflow](xcode/integer-overflow.md)
- [Invalid variable-length array](xcode/invalid-variable-length-array.md)
