Mixing declarations with extern, static and no storage specifier in global scope
问题 I have been investigating when it is possible to mix variables declared with extern , static and no storage specifier in global scope. The results have left me quite confused. This is what I found (each paragraph is a separate compilation unit): /* ok */ int x; int x; /* ok */ int f(); int f(); /* ok */ int x; extern int x; /* ok */ int f(); extern int f(); /* error: static declaration follows non-static declaration */ int x; static int x; /* ok (no warning) */ int f(); static int f(); /* ok