Case sensitivity when linking

Lewis via Digitalmars-d digitalmars-d at puremagic.com
Sat Jan 28 23:17:02 PST 2017


On Sunday, 29 January 2017 at 07:14:52 UTC, Lewis wrote:
> 0. Try the following in DMD on Windows (presumably this issue 
> doesn't exist on Linux, but can't test myself)
> 1. Create File1.d and File2.d. Do something trivial in each 
> that won't get compiled out.
> 2. In File2.d, import File1.d, but change the filename case in 
> the import statement. For example, write
>
>     import FilE2.d;
>
> 3. In File1.d use whatever you imported somewhere, and compile.
>
> When I do this, I get a linker error. If I fix the case in the 
> import statement, it compiles. It looks like this is related to 
> how the symbol names get mangled, and the names not matching up 
> once we get to the link step.
>
> To me, it seems that this should either be:
>
> - A failure during compile instead of link, with a more helpful 
> message about the import failing, or
> - A successful link that is permissive of filename case
>
> I lean towards the former. Thoughts?

This is where I wish I could edit posts. Here is what the above 
should look like, with the typos fixed:

0. Try the following in DMD on Windows (presumably this issue
doesn't exist on Linux, but can't test myself)
1. Create File1.d and File2.d. Do something trivial in each
that won't get compiled out.
2. In File1.d, import File2.d, but change the filename case in
the import statement. For example, write

      import FilE2.d;

3. In File1.d use whatever you imported somewhere, and compile.




More information about the Digitalmars-d mailing list