www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15071] New: filenames and module names with case-insensitive


          Issue ID: 15071
           Summary: filenames and module names with case-insensitive HFS+
           Product: D
           Version: D2
          Hardware: All
                OS: Mac OS X
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: john.loughran.colvin gmail.com

by default, OS X uses case-insensitive-but-case-preserving HFS+ and this is
what almost all OS X users will have.

consider the following (incorrect) code:

% cat chirplet.d 
import mathutil;

auto chirplet()

% cat mathUtil.d 
auto expi(double )

auto exp(T)(T c)
% dmd chirplet.d mathUtil.d -main
Undefined symbols for architecture x86_64:
  "_D8mathutil4expiFNaNbNiNfdZv", referenced from:
      _D8mathutil10__T3expTiZ3expFNaNbNiNfiZv in chirplet.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
--- errorlevel 1

What I think is happening:
While compiling chirplet.d, dmd sees `import mathutil;` and asks the filesystem
for a file called `mathutil.d` in the current directory. HFS+ provides
`mathUtil.d` because it doesn't know any better. dmd continues compiling and
emits references to `mathutil` symbols. dmd compiles `mathUtil.d` and emits
`mathUtil` symbols. Linker sees the case mismatch and fails.

Sep 16 2015