This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS 5.1 #define is not recognized in editor display



Hi, this is more of an Eclipse question but I can't find the answer looking through Eclipse forums or the CCS forums so I'm hoping to get an answer here.

I have code like this in dspPlatform.h:

#ifdef FOO

#define something

#endif

FOO is defined in a .h file called hwSupported.h.

The "#define something" code is greyed out, although it is compiled as I expect (if I add an error between the #ifdef and #endif I get a compile error).

dspPlatform.h does not specifically include hwSupported.h, but hwSupported.h is always listed before dspPlatform.h in lists of include files at the top of c files.

How can I tell Eclipse about this so that it will recognize that FOO is defined and display the file correctly (i.e. the "#define something" line is not greyed out).

I wondered whether this was related to the "Specify a preinclude file (--preinclude)" option available under Build options but can't find enough documentation about this. The post:

http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/130177.aspx#466268

points to a section in a document which looks wrong.

Thanks for your help,

Annie

  • Annie,

    I can't reproduce this issue here in the small testcase I have (check attached). Can you import it and see if this error shows up fo this code?

    The file <sine.h> has a #define that is reflected in <sinewave_gen.h>.

    Regards,

    Rafael

    Sinewave_C2000.zip
  • Rafael - thank you for your reply and the sample project. Although this issue was happening yesterday, it is no longer happening today. I have made many changes to the project since then. Maybe some kind of refresh happened? If I see this again I'll try closing Eclipse windows or CCS. My apologies, I don't like asking about something and then finding that the issue has disappeared.

    Annie.

  • The issue happened again. I added code surrounded by a #ifdef which *should* have been recognized but the code was greyed out.

    I tried several things which did not help. The thing which finally made the code display correctly was going to the Window menu, Preferences, C/C++, Indexer and clicking on the Apply button (without changing any settings).

    The things I tried which didn't help were:

    Building the project, closing the file in the editor window, closing CCS and re-starting it, running the debugger, right-clicking the file name under Project Explorer and going to Index -> Freshen All Files.

  • Annie,

    Thanks for reporting your findings; it seems the indexer is somehow not refreshing its data either timely or accurately.

    Unfortunately these on/off issues are hard to track. I will keep an eye on this issue and see if it shows up here. Having a reproducible test case will help further investigating this.

    Regards,

    Rafael