Will a function declared inside main() have external linkage or none linkage?
I know that external objects have external linkage and internal objects have none linkage
I think that by the term "internal objects" you mean objects declared in block scopes.
As for this declaration
int i; /* definition */
then it is a declaration. You may place several such declarations one after another like
int i; /* definition */
int i; /* definition */
int i; /* definition */
The compiler generates the so-called tentative definition of this variable at the end of the translation unit initializing it by zero.
As for the function declaration in main then according to the C Standard (6.2.2 Linkages of identifiers)
5 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. If the declaration of an identifier for an object has file scope and no storage-class specifier, its linkage is external.
and
4 For an identifier declared with the storage-class specifier extern in a scope in which a prior declaration of that identifier is visible,31) if the prior declaration specifies internal or external linkage, the linkage of the identifier at the later declaration is the same as the linkage specified at the prior declaration. If no prior declaration is visible, or if the prior declaration specifies no linkage, then the identifier has external linkage.
So this function declaration in main
void f_in_other_place (void);
is equivalent to
extern void f_in_other_place (void);
As there is no previous function declaration in the file scope then this function has external linkage.
If for example in the file scope before main there would be a declaration with the keyword static
like
static void f_in_other_place (void);
then the function declared in main would have internal linkage.
From this linkage reference:
external linkage. The identifier can be referred to from any other translation units in the entire program. All non-static functions, all extern variables (unless earlier declared static), and all file-scope non-static variables have this linkage.
[Emphasis mine]
It doesn't matter where you declare the function, it will always have external linkage.