Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 312666 - #include should ignore case for case-insensitive filesystems
Summary: #include should ignore case for case-insensitive filesystems
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-indexer (show other bugs)
Version: 6.0   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 8.0   Edit
Assignee: Markus Schorn CLA
QA Contact: Mike Kucera CLA
URL:
Whiteboard:
Keywords:
: 329242 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-05-12 12:45 EDT by Dmitry Nezhevenko CLA
Modified: 2017-04-20 08:48 EDT (History)
1 user (show)

See Also:


Attachments
fix (3.38 KB, patch)
2010-06-22 07:39 EDT, Markus Schorn CLA
mschorn.eclipse: iplog-
Details | Diff
extends the fix to the include file resolution heuristics. (6.32 KB, patch)
2010-11-04 06:06 EDT, Markus Schorn CLA
mschorn.eclipse: iplog-
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Nezhevenko CLA 2010-05-12 12:45:17 EDT
Build Identifier: I20100312-1448

On Mac OS X file system is case insensitive by default. So it's possible to #include "foo.h" while file is named "Foo.h".

Currently CDT doesn't handle this and marks such includes as unresolved that cause indexer errors. One of possible solutions is some kind of project setting to use case-insensitive #include.

Reproducible: Always

Steps to Reproduce:
1. echo '#include "foo.h"' > foo.cpp
2. echo '// some include' > Foo.h
3. create project from this and index it.
Comment 1 Markus Schorn CLA 2010-05-17 04:29:53 EDT
CDT does handle case insensitive file systems. Your example works on windows. Whether the file system is case sensitive is tested with:
boolean insensitive= new File("A").equals(new File("a"));

What is the result of this test on your mac?
Comment 2 Dmitry Nezhevenko CLA 2010-05-17 05:03:38 EDT
Hi,

result is "false". However filesystem is case insensitive:

% echo aa > testfile
% cat TESTFILE
aa

java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04-248-10M3025)
Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01-101, mixed mode)

This is regular Mac JFS+ filesystem with osx 10.6
Comment 3 Dmitry Nezhevenko CLA 2010-05-17 05:05:39 EDT
Also new File("TESTFILE").exists() returns true after "echo aa > testfile".
Comment 4 Markus Schorn CLA 2010-05-17 07:53:12 EDT
I'd say this is a bug in the jvm.
Comment 5 Dmitry Nezhevenko CLA 2010-05-17 07:57:20 EDT
Looks like similar issue:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=69854

Any workaround planned?
Comment 6 Markus Schorn CLA 2010-05-17 08:29:28 EDT
(In reply to comment #5)
> Looks like similar issue:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=69854
> 
> Any workaround planned?

The workaround used by the platform should be fine for CDT as well. Ideally you'd provide a patch, since you are on a mac you could also test it (while I cannot).
Comment 7 Markus Schorn CLA 2010-06-22 07:39:58 EDT
Created attachment 172405 [details]
fix

I have no means of testing the patch, however it should work.
Comment 8 Markus Schorn CLA 2010-06-22 07:40:32 EDT
Fixed in 8.0 > 20100622.
Comment 10 Markus Schorn CLA 2010-11-04 05:56:25 EDT
*** Bug 329242 has been marked as a duplicate of this bug. ***
Comment 11 Dmitry Nezhevenko CLA 2010-11-04 06:04:48 EDT
Reopening because it's broken again. Such includes are marked as unresolved and it's impossible to navigate them using "F3" or Ctrl+click.

This is Mac OS X 10.6 (default case-insensitive format):

---
% echo "hello" > a.txt
% cat A.TXT
hello
---

java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04-307-10M3261)
Java HotSpot(TM) Client VM (build 17.1-b03-307, mixed mode)

Eclipse:
- eclipse-SDK-3.7M3-macosx-cocoa.tar.gz
- cdt-master-8.0.0-I201011040003.zip
Comment 12 Markus Schorn CLA 2010-11-04 06:06:42 EDT
Created attachment 182356 [details]
extends the fix to the include file resolution heuristics.

Additional fix in 8.0 > 20101104.
Comment 14 Markus Schorn CLA 2010-11-04 06:26:25 EDT
(In reply to comment #11)
> Reopening because it's broken again. Such includes are marked as unresolved and
> it's impossible to navigate them using "F3" or Ctrl+click.
> This is Mac OS X 10.6 (default case-insensitive format):
> ---
> % echo "hello" > a.txt
> % cat A.TXT
> hello
> ---
> java version "1.6.0_22"
> Java(TM) SE Runtime Environment (build 1.6.0_22-b04-307-10M3261)
> Java HotSpot(TM) Client VM (build 17.1-b03-307, mixed mode)
> Eclipse:
> - eclipse-SDK-3.7M3-macosx-cocoa.tar.gz
> - cdt-master-8.0.0-I201011040003.zip

My initial fix did not cover the heuristics for finding included files, I have extended the fix. This should resolve the issue, however I have no means of testing the fix.
In your version the included files should be found (ignoring case) as long as you provide the proper include search path.