points by uecker 2 days ago | 0 comments
A pointer is a type where a null pointer can't be used as a regular value but leads to a trap when dereferenced.
[–] realharo 1 day ago
[–] uecker 1 day ago
I see. For safety a run-time check is enough though.
But it turns out one can have a compile-time error forthis in C as well: https://godbolt.org/z/8E9z66cfs
Trying to change a function return type from e.g. `string` to `string?` would make the backwards-incompatible breaking change immediately visible, and break the builds of all code that relied on not having to check it back when it was `string` - at compile time.