4 ms·
You dont need UB for that. A simple model for both compilers and programmers to understand: "A variable whose address has not been taken need not be reachable
by cv5005 2y ago
You dont need UB for that.
A simple model for both compilers and programmers to understand:
"A variable whose address has not been taken need not be reachable via a random pointer".
I mean that's how an assembly programmer would think - if I put something in r0 I don't expect a store instruction to clobber it.
- UncleMeat 2y agoWhat you describe there is UB. If you define this in the standard, you are defining a kind of runtime behavior that can never happen in a well formed program and the compiler does not have to make a program that encounters this behavior do anything in particular.