Losing the magic
Losing the magic
Posted Dec 6, 2022 20:19 UTC (Tue) by Wol (subscriber, #4433)In reply to: Losing the magic by khim
Parent article: Losing the magic
> > In other words, with C's assumption that UB is impossible, we now have a conundrum if we want to write Operating Systems in C!
> Why would it be so? There are lots of art built around how can you avoid UBs in practice. Starting from switches which turn certain UBs into IBs (and thus make them safe to use) to sanitizers which [try to] catch UBs like race conditions or double-free or out-of-bounds array access.
I notice you didn't bother to quote what I was replying to. IF THE HARDWARE HAS UBs (those were your own words!), and the compiler assumes that there is no UB, then we're screwed ...
Cheers,
Wol
