Suggestion: Object filenames should be fully-qualified module names
Rioshin an'Harthen
rharth75 at hotmail.com
Sat Jan 20 05:42:36 PST 2007
"Kirk McDonald" <kirklin.mcdonald at gmail.com> wrote:
> This ambiguity can be disposed of if an object file's name is its
> fully-qualified module name. If this were true, then we could just say
>
> $ dmd test.d testpkg/test.d -odbuild
>
> and the result would be the build directory looking like this:
>
> build
> test.obj
> testpkg.test.obj
>
> I find this very clean and simple. Since the compiler fails anyway if two
> modules have the same name, there should not ever be overlaps in object
> file names with this scheme. The -op option could probably be safely
> deprecated.
>
> As someone pointed out in #d, this would fail on NTFS if the module's
> fully-qualified name exceeds 255 characters. Though I cannot recall ever
> using a module whose name even approached that limit, this should be
> solved in most cases by truncating the filename at the start. (Hopefully,
> the last 255 characters are unique.) If the object file would fail to be
> unique even then, it can probably be safely declared the coder's fault for
> using a stupid naming scheme.
Votes++
More information about the Digitalmars-d
mailing list