Yes, and with pointer-to-array syntax the bounds checking already works today:
https://godbolt.org/z/oc6MTWjYd
For your syntax we will probably just also add it is an option.
https://godbolt.org/z/oc6MTWjYd
For your syntax we will probably just also add it is an option.
void f(char (*pa)[7]);
void g(int x, char (*pa)[x]);
void h(int x, char p[static x]);
char a[10];
then f(&a) is a constraint violation, and I believe g(7,&a) might actually be UB, whereas h(7,a) is fine. On the other hand, in the latter case void h(int x, char p[static x]) { p = (char *)&x; }
is legal, so extending that with bounds checks is also not without its problems.