[cfe-dev] Filemanager possible issue with case insensitivity in Windows

Reid Kleckner rnk at google.com
Mon Nov 18 15:27:00 PST 2013


This seems like a bug worth filing.  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.


On Sat, Nov 16, 2013 at 1:38 AM, Yaron Keren <yaron.keren at gmail.com> wrote:

> Hello,
>
> 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,
> checking not only that the searched-for file exists but checking what its
> real file name is and use it instead. I'm not sure if it's worth the
> trouble either.
>
> Yaron
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131118/1e98ae86/attachment.html>


More information about the cfe-dev mailing list