Skip to content

Commit

Permalink
Fix ambiguous main address selection.
Browse files Browse the repository at this point in the history
Such ambiguous `main` address selection compiles only because of Issue 9027 and works correctly by pure accident.

* Issue 9027 URL: http://d.puremagic.com/issues/show_bug.cgi?id=9027
* Causing commit from pull dlang#339: 278968f.
  • Loading branch information
denis-sh committed Nov 15, 2012
1 parent c0ac475 commit febee4f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/rt/dmain2.d
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,8 @@ extern (C) int main(int argc, char **argv)
// main (aka Dmain) is really extern(C), but the DMD
// frontend thinks it is extern(D), so we need to cast
// as MainFunc needs to reflect the actual linkage.
return _d_run_main(argc, argv, cast(MainFunc)&main);
int function(char[][]) dmain = &main;
return _d_run_main(argc, argv, cast(MainFunc) dmain);
}

version (Solaris) extern (C) int _main(int argc, char** argv)
Expand Down

0 comments on commit febee4f

Please sign in to comment.