|
|
|
|
|
by dathinab
1641 days ago
|
|
It's kinda the same in C/C++ as far as I can tell. They use the same backend in LLVM/GCC and the code gen options aren't
even that different mainly that rust uses the noalias attribute a lot. > C/C++ in which you can sort of infer the consequences of UB on a single platform with enough experience. UB in C/C++ allows the compiler to arbitrary rewrite your code, and it sometimes does so. All depending on compiler version, enabled compiler flags, optimization level and "seemingly arbitrary" factors (i.e. some optimization passes detect or fail to detect optimizations sometimes for quite surprised reasons). So I don't think you can "sort of infer the consequences" on a single platform in practice. (Maybe in with optimizations disabled, but even then it can be tricky.) |
|