Rust and GCC, two different ways
Rust and GCC, two different ways
Posted Oct 11, 2021 15:34 UTC (Mon) by Wol (subscriber, #4433)In reply to: Rust and GCC, two different ways by farnz
Parent article: Rust and GCC, two different ways
If the hardware behaviour is undefined, that's not C's problem ... it can point out (or not, as the case may be) that what the hardware does may be random.
In your case, there's also the option of saying "The hardware behaviour is undefined, it's down to the compiler how to handle it".
So basically, I'm not saying the concept of UB should be ditched entirely - at the end of the day life is random - but the language CAN and SHOULD specify what happens at the language level (after all, it's maths, it can and should specify deterministic behaviour AT THE LANGUAGE LEVEL). If the language punts it and says "we can't guarantee what the hardware will do", then that's fine. After all, "whatever the hardware does" is deterministic to a point ...
Cheers,
Wol
