I found a rather strange and unfamiliar usage of the static
keyword in C99 and could not find in the language specs nor by experimentation what does it mean:
void set(int t[static 10], int size)
{
// do something with t, not important here
for (int i = 0 ; i < size ; ++i) {
t[i] = size + i;
}
}
It compiles and run fine (demo on repl.it)
My question is then: what does the static
keyword mean in C99 when applied to an array size?
Note: the following is illegal:
int t5[static 10];
error: static or type qualifiers in non-parameter array declarator