D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 9683 - RDMD: Emit error on missing or unexpected main function
Summary: RDMD: Emit error on missing or unexpected main function
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: tools (show other issues)
Version: D2
Hardware: All All
: P4 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-10 11:54 UTC by Andrej Mitrovic
Modified: 2022-12-17 10:42 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Andrej Mitrovic 2013-03-10 11:54:06 UTC
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 Andrej Mitrovic 2013-03-10 15:17:46 UTC
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.'.