2 ms·
I think butlerm was saying that dereferencing a null pointer has system-defined semantics in machine code, and that C should inherit those semantics. > If you
by a_cardboard_box 4y ago
I think butlerm was saying that dereferencing a null pointer has system-defined semantics in machine code, and that C should inherit those semantics.
> If you dereference it, you have a bug no matter what the manifestation on a specific system is.
Sure, if you dereference a null pointer you have a bug. But all sufficiently large programs have bugs, and what happens after you trigger the bug is important. The closer the machine code matches your C code, the more likely you are to be able to diagnose the problem from its symptoms.
- butlerm 4y agoYes, that is what I intended to say (in the first sentence), thanks for explaining it better than I did.