3 ms·
That's what the static keyword means in those array declarators. void func(int x[static 10]); must be called with an argument that is a pointer to the sta
by shift_reset 7y ago
That's what the static keyword means in those array declarators.
void func(int x[static 10]);
must be called with an argument that is a pointer to the start of a big enough array of int. I can't get recent GCC or Clang to warn on violations of this, though.
- spc476 7y agoThere are cases where the compiler can't enforce it: void foo(int *p) { func(p); } How can the compiler know if `p` points to space for 10 integers?