Granularity of restrict qualifier for overlapping pointers, types
The whole point of restrict is to promise accesses through one pointer don't alias another. That said, there are examples where overlapping memory addresses wouldn't imply aliasing. For example: int* arr_ptr0 = &arr[0]; int* arr_ptr1 = &arr[1]; for (int i=0;i<10;++i) { *arr_ptr0 = *arr_ptr1; arr_ptr0 += 2; arr_ptr1 += 2; } The thing is, these pointers actually do point to overlapping memory! For this particular example, guides like this say, e.g.: It is valid . . . to point into the same array object, provided the range of elements accessed through one of the pointers does not overlap with the