Hacker News new | ask | show | jobs
by dependenttypes 2098 days ago
void f(size_t n, int v[n]) is valid C.
1 comments

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.