Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 352539 - fprintf is not resolved
Summary: fprintf is not resolved
Status: RESOLVED INVALID
Alias: None
Product: CDT
Classification: Tools
Component: cdt-indexer (show other bugs)
Version: 8.0   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Markus Schorn CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-20 04:01 EDT by Gunther Piez CLA
Modified: 2011-07-30 04:25 EDT (History)
1 user (show)

See Also:


Attachments
parser log (7.79 KB, text/x-log)
2011-07-30 04:02 EDT, Gunther Piez CLA
no flags Details
stdio.h (30.80 KB, text/x-chdr)
2011-07-30 04:07 EDT, Gunther Piez CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gunther Piez CLA 2011-07-20 04:01:11 EDT
Build Identifier: 20110615-0604

Neither `fprintf` nor `stdout` from <cstdio> are resolved. This happens using gcc-4.5.3 on Linux.

Reproducible: Always

Steps to Reproduce:
1. Create new hello world c++ project.

2. Change it to:

#include <cstdio>
using namespace std;

int main() {
	fprintf(stdout,"!!!Hello World!!!"); // prints !!!Hello World!!!
	return 0;
}
Comment 1 Markus Schorn CLA 2011-07-27 09:09:52 EDT
Works for me on Windows with either cygwin or mingw.

* Please create a parser log for the test file (Context menu of file in project
explorer - Index - Create parser log). 
* Also, try to find the header file that defines stdout and attach it
to the bug.
* Check the project setting 'C/C++ General - Index - Files to index up-front',
what does it contain?
Comment 2 Gunther Piez CLA 2011-07-30 04:02:57 EDT
Created attachment 200618 [details]
parser log
Comment 3 Gunther Piez CLA 2011-07-30 04:07:04 EDT
Created attachment 200619 [details]
stdio.h
Comment 4 Gunther Piez CLA 2011-07-30 04:08:32 EDT
The parser.log shows some interesting lines:

Include Search Path (option -I):
   /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/g++-v4
   /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/g++-v4/x86_64-pc-linux-gnu
   /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/g++-v4/backward
   /usr/local/include
   /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include
   /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include-fixed
   /usr/include
...
Unresolved includes (from headers in index):
   file:/usr/lib64/gcc/x86_64-pc-linux-gnu/4.5.3/include/g++-v4/cstdio
is not indexed

The last file does exist and is valid (and it includes stdio.h).
Interesting enough, I can shift-click the include <cstdio> in the source
and open it.

Files to index up-front contains "stdarg.h, stddef.h, sys/types.h".

- Gunther
Comment 5 Gunther Piez CLA 2011-07-30 04:25:49 EDT
After seeing this strange error it occured to me that I should read my system update log. And indeed, an update of the java sdk (to sun-jdk-1.6.0.26) has happened... and indeed, after reverting to the previous version, it works again.

Sorry for the noise, but who would expect that after some minor jdk update eclipse would suddenly loose the ability to read some files.