LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 17993 - Filemanager possible issue with case insensitivity in Windows‏
Summary: Filemanager possible issue with case insensitivity in Windows‏
Status: NEW
Alias: None
Product: new-bugs
Classification: Unclassified
Component: new bugs (show other bugs)
Version: trunk
Hardware: PC Windows NT
: P normal
Assignee: Unassigned LLVM Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-19 06:09 PST by Yaron Keren
Modified: 2013-11-20 06:53 PST (History)
4 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yaron Keren 2013-11-19 06:09:14 PST
In Windows, files are usually case insensitive. The program may not be able to change this, see  
http://www.nicklowe.org/2012/02/understanding-case-sensitivity-in-windows-obcaseinsensitive-file_case_sensitive_search/

Meanwhile, SeenFileEntries keys in FileManager are case-sensitive, so we may end up with duplicate mappings in SeenFileEntries for the same file, for example

Hello.h
HELLO.H
hello.H

will all map to the same FileEntry.

Furthermore, the file name in FE will be the searched-for filename rather than the real filename. For example, let's say you have hello.h on disk but you searched for HELLO.H. Since stat succeeds with HELLO.H this will be the filename linked from the FE and used in all clang's diagnostics. 

I'm not sure if this should be called a bug but it may not be what the user expects.

Fixing this would require extra work for every file open on Windows, using FindFirstFile looking for file instead of stat checking the file exists.

Reid Kleckner comment on cfe-dev:
I think the correct design is to have multiple strings point to the same FileEntry, which owns the canonical name, rather than pointing to the StringMap key used for the first path encountered.
Comment 1 NAKAMURA Takumi 2013-11-20 06:53:08 PST
How about on darwin?