[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] The defaults of "Index unused headers" and "Index source and header files opened in editor" preferences

Hi,

In this context I just wanted to ask, if it wouldn't be possible to allow indexing an header twice.
We use OSEK here, and there is a header file, which has a "multi stage" inclusion scheme.
Current indexing causes most of the header not indexed, and most of the defines can not be found.

------------------ gen_config.h ------------------------------
#if  PreIncludeStage

/* ... stuff to include in the first stage ... */

#endif

#if PostIncludeStage

/* ... stuff to include in the second stage .... */

#endif
--------------------------------------------------------------

------------------ global.h ------------------------------

#define  PreIncludeStage    1
#define  PostIncludeStage    0

#include "gen_config.h"

#undef  PreIncludeStage
#undef  PostIncludeStage

/* ... */

#define  PreIncludeStage    0
#define  PostIncludeStage    1

#include "gen_config.h"

#undef  PreIncludeStage
#undef  PostIncludeStage

--------------------------------------------------------------



Am 02.03.2012 19:18, schrieb Sergey Prigogin:


On Fri, Mar 2, 2012 at 12:07 AM, xgsa <xgsa@xxxxxxxxx> wrote:
Hi,

Can somebody explain why the "C/C++ --> Indexer --> Index unused headers" preference is off by default?

Indexing of unused headers may result in some files being indexed out of context, which is probably not an issue in 8.1 since index now supports multiple variants of the same header file.
 
It causes inconvenience when I am adding a new header file (which isn't included anywhere) and trying to use "Source --> Add include" feature. Moreover, the context assistant doesn't work properly in this case too. It isn't a very often problem, however it is unclear for end-user why sometimes a newly added classes and functions are not visible. The "C/C++ --> Indexer --> Index source and header files opened in editor" preference helps to resolve the described inconvenience too. Why is it turned by default too?

Mostly for historical reasons. I vote for turning it on by default. Does anybody object? 

Thanks,
Anton

-sergey 
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev



_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev