I don’t think it is possible, not without changing some parts of the C’s specification. At the very least you’d need to be able to somehow encode the length of the buffer in the pointer to it. (There is no semantic difference between a pointer to a simple, fixed-length variable and a pointer to an array.)
You can keep a list of every allocation and every time the code does a memory read/write the implementation can look up to see if the pointer is within a valid allocation space. I have implemented some things like this: https://www.youtube.com/watch?v=pvkn9Xz-xks
Which is what the article proposed.
Which is what hardware implementations like Solaris SPARC do.
void f(size_t n, int v[n]) is valid C.
Semantically though, the second argument is still just a naked pointer.
That’s why you use the proper declaration of
void f(size_t n, int (*v)[n])
instead.
Is it? I am pretty sure that v[x] where x >= n is UB.