// Test: Pointer arithmetic producing a pointer not to the same array object; dereferencing "one-past" or beyond
// Clause: 6.5.7 p29–p36 — if pointer operand and result do not point within the same array object or one-past, the behavior is undefined;
// and if result points one past the last element, it shall not be used as the operand of unary * that is evaluated.
#include <stdio.h>

int main(void) {
    int a[3] = {1,2,3};
    int *p = a + 3;  // one past last element
    // UB: dereferencing one-past (6.5.7)
    int v = *p;
    printf("%d\n", v);
    return 0;
}
