If there is something like this in my code:
void f(struct foo *x, struct foo *y) { *x = *y;
If x and y point to the same address , what happens?
Is this valid code, and what if the compiler converts the assignment into a memcpy call with potentially invalid operands (they are not allowed to overlap)?
[Yes, I know that I can use the "restriction" in this case, but the actual code that we found that made us consider this is automatically generated by the bison, so we were wondering if it should always be valid and whether the compiler should use memmove or something else that allows overlapping ..]
source share