int main(argc, argv) int argc; char **argv; { return 0; } test.c(4): Error: function `test.main` parameters must match one of the following signatures test.c(4): `main()` test.c(4): `main(int argc, char** argv)` test.c(4): `main(int argc, char** argv, char** environ)` [POSIX extension] this used to work before the error was added in https://github.com/dlang/dmd/pull/13749
@MoonlightSentinel created dlang/dmd pull request #13927 "Fix 22961 - Don't reject valid K&R main's in C files" fixing this issue: - Fix 22961 - Don't reject valid K&R main's in C files K&R functions are implicitly variadic and hence triggered the error if the declaration actually specified parameters (even if when their types are correct). This patch changes the check s.t. it allows implicitly variadic K&R functions in C files but still reports an error for explicit `...`. https://github.com/dlang/dmd/pull/13927
Introduced by https://github.com/dlang/dmd/pull/13749
dlang/dmd pull request #13927 "Fix 22961 - Don't reject valid K&R main's in C files" was merged into master: - 9c367327d706b1ba4708b395f97a37bd4ab22d3b by MoonlightSentinel: Fix 22961 - Don't reject valid K&R main's in C files K&R functions are implicitly variadic and hence triggered the error if the declaration actually specified parameters (even if when their types are correct). This patch changes the check s.t. it allows implicitly variadic K&R functions in C files but still reports an error for explicit `...`. https://github.com/dlang/dmd/pull/13927