Bug 9683 – RDMD: Emit error on missing or unexpected main function
Status
NEW
Severity
enhancement
Priority
P4
Component
tools
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-03-10T11:54:06Z
Last change time
2022-12-17T10:42:50Z
Assigned to
No Owner
Creator
Andrej Mitrovic
Comments
Comment #0 by andrej.mitrovich — 2013-03-10T11:54:06Z
After https://github.com/D-Programming-Language/dmd/pull/1732 is pulled RDMD should be able to the following:
1) Emit an error on missing main if 'entry' is not found. This will avoid displaying linker error messages.
2) When RDMD supports building libraries (e.g. using the -lib or maybe --lib/--static switch) it should warn or error if a 'main' function is found. This will avoid linker errors for multiply defined 'main' symbols when the user links the built static library with his code at a later point.
3) When RDMD supports building DLLs it should verify there's an entry point and that the entry point is dllmain.
Comment #1 by andrej.mitrovich — 2013-03-10T15:17:46Z
Actually this can only work if there are no static library or object files passed on the command line to RDMD, since they could potentially contain 'main.'.