logoalt Hacker News

creatolast Monday at 6:05 AM1 replyview on HN

You're right, the thing I linked to do does exactly that. I should have read it more closely.

The projects that I've worked on, unconditionally define it as a thing that crashes (e.g. `std::abort` with a message). They don't actually use that C/C++ thing (because C23 is too new), and apparently it would be wrong to do so.


Replies

ueckerlast Monday at 9:53 AM

You can use the standard feature with the unreachable sanitizer: https://godbolt.org/z/3hePd18Tn