Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

Ticket #18 (closed defect: fixed)

Opened 18 years ago

Last modified 18 years ago

Regarding multiple definition in regards to the new module generation switch

Reported by: Nox / Lux Assigned to: derek
Priority: Important Component: core
Version: 3.0 Severity: minor
Keywords: -module module Cc:

Description

At the moment, when generating a module list file with the command: build -module=module.ddoc file_1.d file_2.d ... file_n.d, if a file is specified in the command line as well as being imported in another file (say, file_2.d is imported in file_1.d as well), the build tool says "module file_2 is in multiple defined" and then enters what seems to be an infinite loop.

A more productive way of dealing with this would be to print the error message, ignore the extra inclusion and just go ahead with generating the module file. There are times when you want to build a module file for a number of .d-files without knowing exactly which is imported in which (if any). Alternatively, you could have a switch for forcing it to ignore duplicates and go ahead with building the file.

Also, the grammar is a bit off in the error message. A better phrase would be "module x is defined multiple times" or something like that.

(ps. thanks for this feature though - it's very useful)

Change History

06/09/06 02:17:56 changed by Derek Parnell

  • status changed from new to closed.
  • resolution set to fixed.

Firstly the error message you are getting "module file_2 is in multiple defined" is coming from DigitalMar?'s dmd compiler and not from Build.

Secondly, this is not related to using the "-modules" switch. You will get the error message either way.

In any case, I've fixed it so that multiply specified source files, regardless of how they are specified, will be silently ignored.