3 ms·
> Dereferencing null is undefined behavior in a C program - which is another way of saying it is considered an error, and there are no guarantees about what wi
by dragontamer 11y ago
> Dereferencing null is undefined behavior in a C program - which is another way of saying it is considered an error, and there are no guarantees about what will happen as a result of it.
Indeed. It is undefined within C. It is an abstraction that C builds on top of. Dereferencing 0 on the vast majority of embedded systems (or kernel-level code) is very well defined.
This is just one of the areas where C has a "leaky abstraction".