Eclipse Luna CDT: What is a Title Variant?

I am having difficulty getting the Eclipse Indexer (Codan) to recognize certain data declarations in header files. There is a new preference for Indexing all heading variations , but does little to explain what that means. Enabling the preference seems to fix the problem. But I would still like to know what the preference is doing.

+3


source to share


1 answer


Let's say you have a title a.h

like this:

#pragma once

#ifndef SYMBOL
#define SYMBOL int
#endif

struct S
{
  SYMBOL sym;
};

      

And now if you include your header like this:

struct UserSymbol
{
  int i, j, k;
};

#define SYMBOL UserSymbol

#include "a.h"

S var;

int main()
{
  var.sym.i = 123;
  return 0;
}

      



then Eclipse CDT may not recognize sym.i

.

You may have more complex examples with deeper nested inclusions or so on.

EDIT:

But if you include a.h

in the list "Index all variants of specific headings" or check "Index all variants of headings". Eclipse will build several variants of indexes a.h

and will "know" that you have identified your specific one SYMBOL

.

+2


source







All Articles