Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filemanager possible issue with case insensitivity in Windows‏ #18367

Open
llvmbot opened this issue Nov 19, 2013 · 1 comment
Open

Filemanager possible issue with case insensitivity in Windows‏ #18367

llvmbot opened this issue Nov 19, 2013 · 1 comment
Labels
bugzilla Issues migrated from bugzilla

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Nov 19, 2013

Bugzilla Link 17993
Version trunk
OS Windows NT
Reporter LLVM Bugzilla Contributor
CC @rnk

Extended Description

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.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Nov 20, 2013

How about on darwin?

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla
Projects
None yet
Development

No branches or pull requests

1 participant