@RichFelker @ch3root The pointer used to access an object has to be derived from a pointer to that same object. Not a different one.
@CopperheadSec @ch3root It's wrong and inconsistent for integers to carry any notion of "calculated from".
-
-
@RichFelker@ch3root The standard doesn't directly allow it but their rationale is that it's allowed under the as-if rule. -
@RichFelker@ch3root i.e. if all other rules of the standard are followed, then this Clang/GCC rule is implicitly followed too. -
@CopperheadSec@ch3root But its not. The rules about integer to pointer conversions and uintptr_t are not respected by this. -
@RichFelker@ch3root The logic is that valid code constructing a pointer this way must derive it from an existing pointer in practice. -
@RichFelker@ch3root It might not be true though... one example is the incorrect __attribute__((malloc)) on strdup in glibc. -
@RichFelker@ch3root It tells the compiler that the returned data (not just the outer pointer) cannot alias an existing pointer. -
@CopperheadSec@ch3root Ouch, that sounds very bad. -
@RichFelker@ch3root Yeah, look at the description in https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#Common-Function-Attributes …. The glibc usage on strdup appears to be completely wrong. - 4 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.