Attention people who think UB is fine
signa11
12 points
10 comments
October 25, 2026
Related Discussions
Found 5 related stories in 218.4ms across 10,486 title embeddings via pgvector HNSW
- Software developers are not okay theHocineSaad · 47 pts · October 10, 2026 · 42% similar
- Stop complaining about enshittification. Use the alternatives alexfortin · 12 pts · October 09, 2026 · 41% similar
- HBM: High-Bandwidth Mistake gok · 11 pts · October 01, 2026 · 39% similar
- Stop Making TUIs underdeserver · 69 pts · August 21, 2026 · 39% similar
- My thoughts on the Bun Rust rewrite kristoff_it · 673 pts · July 09, 2026 · 39% similar
Discussion Highlights (4 comments)
johnea
Isn't a solution to simply not use unreachable()?
pestatije
UB - undefined behaviour
charleslmunger
This is sort of true, except that behavior can be undefined in the standard but defined in your implementation. One of the best examples is -fwrapv, which makes signed integer overflow not UB. And Fil-C has no undefined behavior that I'm aware of. But most implementations target the standard and "define" what the standard doesn't to be "whatever I feel like, in service of implementation simplicity and performance". What matters is what your implementation guarantees, which should be a superset of what the standard does.
omoikane
The first example should have changed the heading to "C++ code" as opposed to "C code" due to the use of `std::unreachable()`. This matches the godbolt link. Another alternative is to use `__builtin_unreachable()` (not standard, but available in GCC and Clang).