On Saturday, 24 December 2016 at 01:38:24 UTC, safety0ff wrote:
On Friday, 23 December 2016 at 22:11:31 UTC, Walter Bright wrote:

For this D code:

enum SIZE = 100000000;

void foo(int* a, int* b) {
    int* atop = a + 1000;
    ptrdiff_t offset = b - a;
    for (; a < atop; ++a)
        *a &= *(a + offset);
}

Is subtraction of pointers which do not belong to the same array defined behavior in D?

Yes, I think so.
There are not crazy rules to make pointer math ub.

Reply via email to