Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Indigo indexer shows bugs, Helios just ignores(Some less-frequently used , conditionally defined structures are not recognized by built-in parser/indexer. This leads to unresolved inclusions.)
Indigo indexer shows bugs, Helios just ignores [message #722308] Mon, 05 September 2011 06:35
Eclipse UserFriend
I'm trying to use a particular structure from <time.h> itimerspec, for use with the timerfd library.
The structure is defined in <timer.h>:
struct itimerspec
  {
    struct timespec it_interval;
    struct timespec it_value;
  };


However, when I try to use it in a test program like this, Helios shows red bugs in the left sidebar, with the notification "Field 'tv_sec' could not be resolved"
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main(void) {
	struct timespec timer;
	timer.tv_sec=1;
	timer.tv_nsec=123456789;
	printf("timer          = %i.%9li\n", (int) timer.tv_sec, timer.tv_nsec);
	nanosleep(&timer, NULL);

	struct itimerspec itimer;
	itimer.it_value.tv_sec=1;
	itimer.it_value.tv_nsec=123456789;
	printf("itimer.itvalue = %i.%9li\n", (int) itimer.it_value.tv_sec, itimer.it_value.tv_nsec);

	return EXIT_SUCCESS;
}

These 'bugs' also show up in the "Problems" view. "Problem Details" adds 'Name resolution problem found by indexer'.

Content completion within the editor also fails for the structure itimer: when I enter 'itimer.' in the editor, the popup shows 'itimerspec:?'.

Interestingly, the program compiles without any complaints from gcc.

When I open the included <time.h> header, the Outline view shows the structure itimerspec, but grayed out. Same for the structure timespec but that doesn't seem to have the same indexing problems.

I can reproduce the problem with autocompletion in Helios (Eclipse 3.6) but in that case, the 'bugs' are not flagged - just ignored.

The indexer logs the problem in .metadata/.log:
!ENTRY org.eclipse.cdt.core 1 0 2011-09-05 12:32:41.625
!MESSAGE Indexed 'test_posix' (1 sources, 44 headers) in 0.25 sec: 1,417 declarations; 1,636 references; 3 unresolved inclusions; 0 syntax errors; 12 unresolved names (0.39%)


Any suggestions?
Previous Topic:Help with OpenCV
Next Topic:How to debug C++ code called from a JAVA Simulation Program
Goto Forum:
  


Current Time: Sat Jul 19 05:42:10 EDT 2025

Powered by FUDForum. Page generated in 0.04116 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top