| Summary: | CDT Indexer cannot resolve some symbols in header files in "Includes path" | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Dan Lee <danleepw> | ||||||||
| Component: | cdt-indexer | Assignee: | Project Inbox <cdt-indexer-inbox> | ||||||||
| Status: | RESOLVED INVALID | QA Contact: | Markus Schorn <mschorn.eclipse> | ||||||||
| Severity: | normal | ||||||||||
| Priority: | P3 | CC: | cdtdoug, hrogge, mooroon2, yevshif | ||||||||
| Version: | 7.0.2 | ||||||||||
| Target Milestone: | --- | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Linux | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
Dan Lee
Created attachment 196956 [details]
screen cap of local time.h outline
Created attachment 196957 [details]
screen cap of /usr/include/time.h outline
My Linux env is: Fedora 14, 2.6.35.13-91.fc14.i686, gcc 4.5.1 Please attach time.h and indicate which preprocessor condition causes the code to become inactive. In the project properties, check the indexer setting 'Files parsed up front'. Files parsed up front: cstdarg, stdarg.h, stddef.h, sys/resource.h, ctime, sys/types.h, signal.h, cstdio Actually, i don't know which preprocessor condition causes the code to become inactive since they have different behavior in local and include path. Created attachment 196960 [details]
time.h
glibc-headers-2.13-1.i686 (In reply to comment #5) > Files parsed up front: cstdarg, stdarg.h, stddef.h, sys/resource.h, ctime, > sys/types.h, signal.h, cstdio > Actually, i don't know which preprocessor condition causes the code > to become inactive since they have different behavior in local and include > path. Rephrasing the question: The inactive code is shown with a grey background in the editor. The grey section has to start at some preprocessor statement, which one is it? (In reply to comment #8) > (In reply to comment #5) > > Files parsed up front: cstdarg, stdarg.h, stddef.h, sys/resource.h, ctime, > > sys/types.h, signal.h, cstdio > > Actually, i don't know which preprocessor condition causes the code > > to become inactive since they have different behavior in local and include > > path. > > Rephrasing the question: The inactive code is shown with a grey background in > the editor. The grey section has to start at some preprocessor statement, which > one is it? time.h: line number 130 #ifdef _TIME_H Hello, any update about this bug? (In reply to comment #10) > Hello, any update about this bug? You should be able to resolve the issue by adding time.h into the list of files parsed front up. I guess (I have different system headers) it is best to insert it after <ctime>. If this does not work, move it as far to the front as necessary (but not any further): Try: cstdarg, stdarg.h, stddef.h, sys/resource.h, ctime, time.h, sys/types.h, signal.h, cstdio No response from submitter. I experience just the same bug using Eclipse 3.7.1 Stable. Should I report a new issue or would it be possible to reopen this one? Problem is just the same: including time.h in pure-C linux code results in advanced things like nanosleep(), CLOCK_MONOTONIC and struct timespec to be unresolved by indexer. Adding time.h into list of the headers that should be indexed up-front improves situation a bit but still CLOCK_MONOTONIC remains unresolved. P.S. To enable usage of nanosleep and other fancy features I define _POSIX_C_SOURCE symbol equal to 199309L. Same effect might be achieved by defining _GNU_SOURCE but defining _POSIX_C_SOURCE provides more fine-graided control on what glibc subsets are being exposed so I prefer to use it instead of _GNU_SOURCE. Update: In my case it had been possible to workaround the problem by setting up-front parse list to this: cstdarg, stdarg.h, stddef.h, ctime, time.h, sys/resource.h, sys/types.h, signal.h, cstdio I have the same problem, even with the feature macros set CLOCK_MONOTONIC cannot be resolved. |