Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 350646

Summary: Codan and indexer fail to resolve stdio.h
Product: [Tools] CDT Reporter: Josh Kelley <joshkel>
Component: cdt-indexerAssignee: Project Inbox <cdt-indexer-inbox>
Status: RESOLVED INVALID QA Contact: Markus Schorn <mschorn.eclipse>
Severity: normal    
Priority: P3 CC: cdtdoug, malaperle, yevshif
Version: 8.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
stdio.h and the files it includes from Embarcadero C++Builder none

Description Josh Kelley CLA 2011-06-28 21:40:33 EDT
Build Identifier: 20110615-0604

I'm unable to get Eclipse's indexer to recognize functions and types (like FILE) in stdio.h.

Some other C library functions work, and some don't.

I'm using Eclipse CDT to edit Embarcadero (formerly CodeGear, formerly Borland) C++Builder projects.  It has a few vendor extensions to C++, but I can't see where those would affect C runtime libraries.  

I do not believe that this problem is new to CDT 8.0, but Codan's "could not be resolved" error messages make it much more obvious.

If I press F3 in "#include <stdio.h>", Eclipse opens stdio.h as expected, so it is able to resolve the #include.

Reproducible: Always

Steps to Reproduce:
1. Open a C++Builder project in Eclipse CDT.
2. Open a source file that calls fopen or sprintf.
3. Note all the complaints from Codan.
Comment 1 Marc-André Laperle CLA 2011-06-29 01:11:50 EDT
Maybe some headers are included multiple times? (Bug 197989)
Comment 2 Josh Kelley CLA 2011-06-29 21:50:32 EDT
(In reply to comment #1)
> Maybe some headers are included multiple times? (Bug 197989)

I think that this issue is unrelated.  If I include only stdio.h, I get the same symptoms.
Comment 3 Marc-André Laperle CLA 2011-06-30 00:28:24 EDT
(In reply to comment #2)
> (In reply to comment #1)
> > Maybe some headers are included multiple times? (Bug 197989)
> 
> I think that this issue is unrelated.  If I include only stdio.h, I get the
> same symptoms.

I mean inside stdio.h. Can you see files included multiple times in stdio.h or files that it includes?
Comment 4 Josh Kelley CLA 2011-06-30 07:43:16 EDT
(In reply to comment #3)
> I mean inside stdio.h. Can you see files included multiple times in stdio.h or
> files that it includes?

I checked, and stdio.h has no duplicate includes.
Comment 5 Markus Schorn CLA 2011-07-04 08:25:31 EDT
Please attach the version of stdio.h you are using.
Comment 6 Josh Kelley CLA 2011-07-05 23:05:28 EDT
Created attachment 199154 [details]
stdio.h and the files it includes from Embarcadero C++Builder

stdio.h and the files it includes are attached.
Comment 7 Markus Schorn CLA 2011-07-06 02:55:24 EDT
(In reply to comment #6)
> Created attachment 199154 [details]
> stdio.h and the files it includes from Embarcadero C++Builder
> stdio.h and the files it includes are attached.

Hmm, I don't see any problems using these header files. I created a project with the headers added 'test.c' which includes 'stdio.h' and uses FILE. Does it work for you if you do the same?
Please share a code snippet where 'FILE' cannot be resolved and create a parser-log for the file containing the snippet (Context menu of file in project explorer - Index - Create Parser Log).
Comment 8 Markus Schorn CLA 2011-08-19 08:19:25 EDT
No response from submitter.