[dmd-internals] "Previous Definition Different" w/ array ops

Jonathan M Davis jmdavisProg at gmx.com
Tue Feb 15 10:30:25 PST 2011


On Tuesday, February 15, 2011 09:38:48 David Simcha wrote:
> BTW, to deal with annoying errors like this, how hard would it be to
> compare implementations when a symbol is defined multiple times and, if
> the implementations are identical, just pick one and use it?  Of course I
> know in the short term this is hard b/c OPTLINK isn't translated to C yet,
> but let's assume longer term that we will have a sane linker codebase.

C linkers don't normally work that way. If they did, you wouldn't generally get 
multiple definition errors and the like. So, while it might be theoretically 
reasonable, it might be too much of a change from how linking normally works. 
And since it would ultimately just be optlink which would work that way, would 
it really be a good idea anyway? As soon as you tried your code with another 
linker - e.g. by compiling on Liunx - it would fail.

- Jonathan M Davis


More information about the dmd-internals mailing list