Hacker News new | past | comments | ask | show | jobs | submit login

Even better, just actually perform undefined behavior on that branch and the compiler will get rid of it.



This is literally what __builtin_unreachable() does. But it has the added benefit of the compiler understanding the intent so it works well with diagnostics.


But that's a builtin, rather than something that's part of the core language :)




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: