 <p>There's nothing special here about it being main(). The same will happen if you do this for any function. Consider this example:</p> <p>file1.cpp:</p> <pre><code>#include &lt;cstdio&gt; void stuff(void) { puts("hello there."); } void (*func)(void) = stuff; </code></pre> <p>file2.cpp:</p> <pre><code>extern "C" {void func(void);} int main(int argc, char**argv) { func(); } </code></pre> <p>This will also compile, and then segfault. It is essentially doing the same thing for the function func, but because the coding is explicit it now more apparently looks wrong. main() is a plain C type function with no name mangling, and just appears as a name in the symbol table. If you make it something other than a function, you get a segfault when it executes a pointer. </p> <p>I guess the interesting part is that the compiler will allow you to define a symbol called main when it is already implicitly declared with a different type. </p>