News for hackers. Stuff that matters.
Re:Why Not Just Do Simple C++ RAII in C? by jay-barronville on Wednesday May 22, 2024 @04:21PM (#40445924)
> Suppose we want to make division by zero and null pointer dereference defined.

A good example is WebAssembly*—address 0x00000000 is a perfectly fine and well-defined address in linear memory. In practice though, most code you’ll come across targeting WebAssembly treats it as if dereferencing it is undefined behavior.

* Of course WebAssembly is a compiler target rather than a language, but it serves as a good example of the point you’re making.

There are no comments on this comment yet.