I'm asking this question as a follow up from this post. They say that the extern
block declaration has external linkage and not internal linkage, but I'm not sure why:
static int i = 0; // #1
void g() {
extern int i; // #3 external linkage
}
Why doesn't the extern declaration take the linkage of i
(internal linkage)? The quote in the post seems to allow that. In the example after the OP's quote it has:
static void f();
void g() {
extern void f(); // internal linkage
// ...
}
and it says that the extern declaration has internal linkage. Why is there a difference when using variables and functions?