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: indexer sees a *.c file as c++ if language is TU GNU C

Tool/software: Code Composer Studio

Hi

I was struggling with the indexer keep saying that __cpluplus is defined in my C only project. Couldn't find any answers in the forums, except someone asked it before, with no resolutions.

I am working in CSS: 9.0.0.00018 .

I created a new test project, and here the __cplusplus macro was correctly not defined.

I added this to the default main.c

#ifdef __cplusplus
#error This is not C++
#endif

I then copied the exact same code (the complete main.c) back into main.c in my existing project and confirmed that here the __cplusplus macros was defined (only by the indexer, not the compiler)

I created a indexer log file, and started to compare, fir thing i noticed was that the indexer was convinced that main.c in my existing project was a C++ file

from the original project:

Project: Delfino
File: file:/C:/src/dd00258457/dsp/main/main.c
Language: TI GNU C
Index Version: 213.0
Build Configuration: Debug
Context: file:/C:/src/dd00258457/dsp/main/main.c
C++, {}
Versions in Index: 1
C++: {}; 0 macros, 0 includes, 2 names;

From the newly created test project:

Project: test
File: file:/C:/temp/test/main.c
Language: GNU C
Index Version: 213.0
Build Configuration: Debug
Context: file:/C:/temp/test/main.c
C, {}
Versions in Index: 1
C: {}; 0 macros, 0 includes, 2 names;

Affter some poking around it dawned on me, that the language was a little different TI GNU C vs. GNU C.

I found that my project had definitions in "Language mappings" mapping c source files to TI GNU C (similar for c header and c++ source/header).

I removed those mappings leaving it empty, so now the workspace settings is in charge (Note the workspace itself was recently created), the "Language mappings" in the workspace is however also empty, leaving it to some hidden default.

But now the __cplusplus macro is no longer defined in my project, and the parserlog file also says.

Project: Delfino
File: file:/C:/src/dd00258457/dsp/dsp/main/main.c
Language: GNU C
Index Version: 213.0
Build Configuration: Debug
Context: file:/C:/src/dd00258457/dsp/dsp/main/main.c
C, {}
Versions in Index: 1
C: {}; 0 macros, 0 includes, 2 names;

So this leaves the question is the TI GNU C language flawed, or is this a obsoleted setting that we should avoid?

I do not yet know if it will have any other implications in my project that I removed the language mappings?

  • Hello Martin,

    This is a known issue that started with CCSv9.x:

    https://sir.ext.ti.com/jira/browse/EXT_EP-9603

    Unfortunately, there is still no resolution. You can follow the progress of this bug using the link above.

    Thanks

    ki

  • Looking at the linked forum post from that bug report, it seams that the relation to "TI GNU C" vs "GNU C" is not present and probably important in the debug process.

    The original post being locked, how Do I add?

    Also I do provide a workaround that other might benefit from, how to add?

    .

     

  • Hi Martin,

    Martin Hansen said:
    Looking at the linked forum post from that bug report, it seams that the relation to "TI GNU C" vs "GNU C" is not present and probably important in the debug process.

    You are correct, this is very important data. I will update the bug details myself with this data.

    I also experimented around with this and interestingly, I found that the Language Mapping settings were blank for both my project and workspace... but CCS seems to default to TI GNU C. When I explicitly add a Language Meppings setting for C Source File to GBU C, then issue goes away.

    Thanks for all your additional analysis.