Laurijssen said:
Well I read in K&R that when extern is omitted it's a temporary declaration.
Only after the compiler sees an extern declaration its final and the
compiler issues an error message when the signature of the function changes
in another delaration. I thought maybe it's a standard C thing or just K&R
I think you're confused. For /object/ types (not functions), a
file-scope declaration without a linkage specifier, or with the
"static" linkage specifier, /and/ without an initializer, is called a
"tentative" definition. Basically, it allows you to fill in more
information later.
For instance, if want to define a file-scope variable "int_value",
it's allowed to define it like this:
static int int_value;
and use it from within function bodies, etc., and then later on in the
same translation unit you could give it an explicit initial value:
static int int_value = 100;
This will make it have the value 100 before it ever gets used by any
of the functions, and also removes the "tentativity" of the
definition.
But, even if you never explicitly clarify the tentative definition,
the details will still be filled in implicitly. Initializers are given
their "default initializer" (basically, zeroes). Definitions like:
int foo[];
become:
int foo[1] = {0};