I was just browsing through gcc
source files. In gcc.c
, I found something like
extern int main (int, char **);
int
main (int argc, char **argv)
{
Now my doubt is extern
is to tell the compiler that the particular function is not in this file but will be found somewhere else in the project. But here, definition of main
is immediately after the extern
declaration. What purpose is the extern
declaration serving then?
It seems like, in this specific example, extern
seems to be behaving like export
that we use in assembly, wherin we export a particular symbol outside of the module
Any ideas?