[Issue 22831] New: No error for malformed extern(C) main function

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Mar 1 17:22:27 UTC 2022


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

          Issue ID: 22831
           Summary: No error for malformed extern(C) main function
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: moonlightsentinel at disroot.org

DMD silently accepts extern(C) main functions with arbitrary arguments / return
type. The spec[1] exlicitly requires one of the following forms:

extern (C) int main() { ... }
extern (C) int main(int argc, char** argv) { ... }

[1] https://dlang.org/spec/function.html#betterc-main

--


More information about the Digitalmars-d-bugs mailing list