...
One compliant solution is to simply remove the restrict-qualification from the affected pointers.
Code Block | ||||
---|---|---|---|---|
| ||||
int * a; int * b; extern int c[]; int main(void) { a = c[0] = 17; b = c[1] = 18; *a = *b; /* undefined behavior */ } |
...
In this compliant solution, the function f()
is unchanged but the programmer has ensured that none of the calls to f()
result in undefined behavior. The call of f()
in g()
is valid because the storage is allocated to d
is effectively subdivided divided into two disjoint objects.
...