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.

Compiler/TMS320F28379D: Definition of the symbol "__cplusplus"

Part Number: TMS320F28379D

Tool/software: TI C/C++ Compiler

Hello,

I have a question regarding the C-Compiler of the F28379D.

 

Currently I´m working on the LAB2 example of the one day workshop. In the source file F2837xD_SysCtrl.c the symbol “__cplusplus” is used.

 

 

#ifndef __cplusplus

//#pragma CODE_SECTION(InitFlash, "ramfuncs");

//#pragma CODE_SECTION(FlashOff, "ramfuncs");

 

 

#pragma CODE_SECTION(InitFlash, ".TI.ramfunc");

#pragma CODE_SECTION(FlashOff, ".TI.ramfunc");

 

#endif

 

Where is this symbol defined?

 

Best Regards

 

Ralf

  • Hello Ralf,

    The __cplusplus compiler symbol allows the bit field header files to be used in C++ projects.  If you are making a C++ project, you would define the symbol in the CCS project properties under compiler->predefined_symbols.  Since the lab you are looking at is written in C, the symbol has not been defined.

    Regards,

    David

  • Dear David,
    thank you very much for your response.

    I´m a little bit confused regarding the state of the __cplusplus and the consequences for the compiling and linking of my project. In order to describe my problem I have made some screenshots. Please look in the attached file.

    Best regards
    Ralf

    dok1.pdf

  • Ralf,

    There seems to be some weird behavior concerning the highlighting of conditional compilation with __cplusplus.  I am using CCSv9.3.0.00012.  I put some test code into a file to check the whether __cplusplus is defined (which it is NOT):

    But the greyed out portions of the code are for __cplusplus being undefined.  The active portions are for __cplusplus being defined.  This is wrong.

    When I compile this file, I get expected warnings for __cplusplus being undefined:

    which means the code builds correctly.  It is just the highlighting of the conditional statements that is wrong.

    Further, it seems this problem exists only for the __cplusplus symbol.  If I do the same thing with, for example, _FLASH, the highlighting is correct.  Here, _FLASH is NOT defined:

    Even more weird, if I remove one of the two underscores from __cplusplus, or add a third underscore, the highlighting is correct.

    Regards,

    David

  • Hello,

    I can reproduce the issue with all CCSv9.x builds. But it works fine with CCSv8.3. Looks like some regression introduced in CCSv9.0.

    I filed a bug for this. Tracking ID: CCSIDE-3757

    Thanks

    ki