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?