2 ms·
Definitions, yes. Declarations can appear inside functions, but it's not common to see. int f(int x) { extern int g(int); return g(x + 1) -
by kps 3y ago
Definitions, yes. Declarations can appear inside functions, but it's not common to see.
int f(int x)
{
extern int g(int);
return g(x + 1) - 1;
}
- tpoacher 3y agoThis is doubly interesting, since the whole point of auto in the nested scenario is precisely to prevent the default "externness" of the declaration. But, if the definition itself cannot appear in the enclosing block scope in the first place without the gcc extension, then I suppose an auto keyword here would still be meaningless (if not misleading / dangerous possibly UB?).
- uecker 3y agoauto is not allowed for a function declaration with block scope without the GCC extension.