3 ms·
Segfaults are an implementation detail of your hardware architecture. They are not a "thing" in the C standard. In the good old days before protected mode on x8
by Thiez 10y ago
Segfaults are an implementation detail of your hardware architecture. They are not a "thing" in the C standard. In the good old days before protected mode on x86 was a thing (if I recall correctly windows 95 was from this era) most of the time you would not segfault (unless you addressed RAM that wasn't there? I'm not sure anymore).
If the C standard did not allow pointer dereferences to be optimized out, many optimizations would become impossible, and people would switch to a language that did allow this.