dmd -c behaviour doesn't take account of packages.

Jacob Carlborg doob at me.com
Thu Feb 23 04:41:32 PST 2012


On 2012-02-22 23:43, Jonathan M Davis wrote:
> On Wednesday, February 22, 2012 23:33:57 Bernard Helyer wrote:
>> On Wednesday, 22 February 2012 at 22:05:51 UTC, Jonathan M Davis
>>
>> wrote:
>>> Then what happens when you have
>>>
>>> dmc -c foo/a.d foo_a.d
>>
>> Good point.
>>
>>> Regardless, I really wouldn't like the idea of screwing with
>>> the object file
>>> names to try and avoid collisions.
>>
>> Well, the thing is in this case everything is being passed to the
>> compiler. It knows the names of everything. But yeah, I think
>> complaining is fine _if_ dmd allows individual modules to be
>> named explicitly. Otherwise, all in one is good. But really, even
>> prefixing it would be better than what we have now. What about
>> 'module.foo_a.o' if foo_a isn't in a package?
>
> I really think that it should either put it in a single object file or complain
> and disallow it. Really, the correct way to build such modules is to put each
> object file in a directory hierarchy which matches the modules. Anything else
> is a mess. But that's the job a build tool, not the compiler. So, it should do
> what's reasonable, which doesn't include renaming files to avoid module
> collisions IMHO.
>
> - Jonathan M Davis

I don't agree. The compiler should just put the object files in the same 
directory and use the fully qualified module name.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list