Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: in progress

...

One compliant solution is to simply remove the restrict-qualification from the affected pointers. 

Code Block
bgColor#ccccff
langc
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.

...