# Clang -fbounds-safety

13 Hacker News commenters recommended Clang -fbounds-safety and 3 criticized it, November 2025 to November 2026. It was recommended in 6 of 13 months. It meets the Hacker Approved badge rule.

**Verdict:** Clang extension that adds bounds checking to C, catching out-of-bounds memory access that causes many security bugs. Main caveat: it needs annotations and protects only bounds.

## Why people recommend it

- Stops out-of-bounds memory access (3 comments): "Very cool. I always wondered why there isn't something like this in GCC/LLVM, it would obviously solve uncountable of security issues." ([source](https://news.ycombinator.com/item?id=47074818)) "this is amazing, counter to what most ppl think, majority of memory bugs are from out of bounds access" ([source](https://news.ycombinator.com/item?id=47074771)) "life saving feature for C developers" ([source](https://news.ycombinator.com/item?id=47077504))
- Used in kernel and WebKit (2 comments): "If it's good enough for the kernel, then it's good enough for me to start using in my own projects." ([source](https://news.ycombinator.com/item?id=47077758)) "The WebKit folks have apparently been very successful with the annotations approach" ([source](https://news.ycombinator.com/item?id=47079364))
- Incremental adoption with ABI compatibility (2 comments): "legacy C code can/should absolutely use things like clang's -fbounds-safety" ([source](https://news.ycombinator.com/item?id=48520800)) "It offers ABI compatibility and incremental adoption." ([source](https://news.ycombinator.com/item?id=49294560))
- Works as a stand-in slice type (2 comments): "this is a minor inconvenience for having an otherwise working span type in C" ([source](https://news.ycombinator.com/item?id=47076887)) "serves as a decent stop-gap to a proper slice type" ([source](https://news.ycombinator.com/item?id=49056188))

## Cite as

Hacker Approved, "Clang -fbounds-safety", https://hackerapproved.com/p/clang-fbounds-safety/ (counts from 1,795,640 Hacker News comments, November 2025 to November 2026).
