I just looked it up. C11 7.22.3p1 "If the space cannot be allocated, a null pointer is returned." and […]
Consider X=SIZE_MAX; p=calloc(X,X); if(p) printf("%p %p\n", p, p+X+1); // opt reducing alloc'd size is invalid.
-
-
I think you could say as long as the pointer is considered valid, it's okay ("magic compression").
-
No, there are clear violations of as-if rule (xform produces output non-xformed ver provably doesn't produce).
-
Yes, that would only be valid if it were something calloc did anyway.
-
calloc can't do that. All objects have unique addresses, all array members have unique offsets.
-
:-/ If the program never checks that, isn't it as-if it can do magic?
-
That's what I was saying - without asserting non-existence of any code that sees the diff, the xform is invalid
End of conversation
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.