www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22961] New: importC: K&R-style main function rejected

https://issues.dlang.org/show_bug.cgi?id=22961

          Issue ID: 22961
           Summary: importC: K&R-style main function rejected
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: ImportC, rejects-valid
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: duser neet.fi
                CC: duser neet.fi

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

--
Mar 29 2022