|
|
|
|
|
by Yoric
275 days ago
|
|
Note that, in compiler lingo, unspecified and undefined are two different things. C++ is specified to death, but full of undefined behavior (and also some unspecified behavior). Rust is largely not specified, but aims to have no undefined behavior (outside of unsafe blocks). |
|
In C undefined is used primarily when there is not a reliable and efficient mechanism for detecting a problem is happening. For example a C implementation may check every single invalid pointer deref, but more realistically it only detects only extreme out of range. So it’s undefined what happens.