I'm a bit confused with a topic in the C17 standard.
In 6.2.2, point 5 you can read:
If the declaration of an identifier for a function has no storage-class specifier, its linkage is determined exactly as if it were declared with the storage-class specifier extern. [...]
Meaning that it could have either internal or external linkage, depending on other declarations (if any) of that function before that one.
On the other hand, in 6.7.6.3, example 1 (points 16 and 17), you can read:
int f(void), *fip(), (*pfi)();
[...]
If the declaration occurs outside of any function, the identifiers have file scope and external linkage. [...]
So, it's ok with pfi
(it's not a function, but a pointer), but what happens then to f
and fip
? Isn't that a contradiction? In 6.2.2, it's "as if the extern storage-class specifier was present" (which doesn't always mean it will have external linkage), but in 6.7.6.3 it seems the external linkage is given for granted.
What am I missing?
Edit: to be more specific, if we have this code in file scope:
// One random "previous declaration":
static int f(void); // declares internal linkage
// Now, the important line, from the initial example:
int f(void); // Internal linkage? External linkage?
6.2.2 states that the second declaration has internal linkage.
6.7.6.3 states that the second declaration has external linkage.