Comment

Comment by mpyne

> That's no surprise, "unreachable()" is basically an instruction to the compiler to stop generating code from that point on, and the compiler obeyed.

It's not a command to compiler to stop generating code.

It's a permission slip that allows the compiler to assume that code that follows is dead code, eligible to be optimized out, including eliminating potentially dead stores and loads.

Which is to say, it's precisely what any other UB is, which is why deliberate use of UB is very bad idea.

parent mpyne 6 days ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton