Clang will more aggressively use undefined behavior on pointer addition overflow
releases.llvm.org
releases.llvm.org
Of course you can optimize away the checks but that doesn't count in my world because people put in these checks to make sure there is no overflow and optimizing them away is just wrong.
But I am sure there are other interesting optimizations that this allows and since I am generally against UB I am curious what those are.
Sigh
Please clarify again, in which machines does pointer overflow does not work but uintptr overflow works?
In which fsking universe does pretending that "pointer overflow" does not do what it does helps anyone except some language lawyers to feel superior to other people?
> The -fwrapv flag now only makes signed integer overflow well-defined, without affecting pointer overflow, which is controlled by a new -fwrapv-pointer flag. The -fno-strict-overflow flag now implies both -fwrapv and -fwrapv-pointer and as such retains its old meaning.
Ah cool, so you have a "work properly" flag, interesting.
I was first going to say that this would only apply on embedded devices or kernel code
But note, the problem here is not if overflowing (pointer + offset) points to a valid address, but simply if the calculation works
Though maybe you're right, I guess in modern platforms this almost always never apply and my rant is over the top