|
|
|
|
|
by wuch
3270 days ago
|
|
A lot of undefined behaviour on this list is quite specific to the C programming language, so it would be like comparing apples to oranges.
Though, one major impression I think you will get after going through this list is that there is no good reason for making those things an undefined behaviour in the first place.
For example, "The result of the preprocessing operator ## is not a valid preprocessing token", really? Regarding those things that actually matter for programmer, following would be well-behaved in Rust (including unsafe blocks): conversion between types, integer arithmetic, pointer arithmetic (there are generally two variants of operations, one that essentially treats pointers as unsigned integers, and another one that behaves like in C with more opportunities for optimization).
On the other side of the coin, in Rust mutable references cannot be aliased. |
|