I think the reasons are different for the different usages that this keyword has. If we take the function scope and file scope use as of classical C for granted (they are at least similar concepts) the first addition off topic is the static
in C++ to name a global member of a class.
I guess here the shortcut was just that "static" and "global" seemed to be close enough and early C++ was very careful not to introduce new keywords that would break existing code. So they took an existing one that could not appear in that context.
For the C99 add-on for array parameters things are different, I think, because static
is not the only addition, here. You may also have type qualifiers (const
and volatile
) that qualify the implicit pointer:
void toto1(char str[const 5]);
void toto2(char*const str);
define compatible prototypes. I can only speculate that the choice of the storage class specifier static
for the purpose that you mention (minimum length of the array) was seen as a natural extension of that syntax. Also probably it easily proved that this use was compatible with the rest of language, by arguing where a type qualifier may be used to extend the language, a storage class specifier can't do much harm.