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.

Wrong code highlight when using compilator's defines



Host: Ubuntu 14.04.3 x64

CCS Version: 6.1.1.00022

Code Composer highlights wrong sections of #if ... #else preprocessor directive when using something defined by compiler.

Code sample:

#include <msp430.h>
#if defined(__TI_COMPILER_VERSION__)
#warning TI Compiler Version defined
#else
#warning TI Compiler Version not defined
#endif
int main(void) {
    WDTCTL = WDTPW | WDTHOLD;    // Stop watchdog timer
    
    return 0;
}

Result: warning: TI Compiler Version defined, but Code Composers shows this on gray background and thinks the #else part is executed.

The excepted result is to show #else part on gray background.

  • Hello,
    Yes I can reproduce this on my Ubuntu 14.04 environment, while on Windows it works fine.

    I filed a bug for this. Tracking ID: SDSCM00052561

    Thanks
    ki
  • Ki-Soo Lee said:
    Yes I can reproduce this on my Ubuntu 14.04 environment, while on Windows it works fine.

    With CCS 6.1.1 under CentOS 6.7 I am getting the same problem with a CCS project which uses the TI ARM compiler.

    I think the problem is that under Linux CCS isn't obtaining the compiler pre-defined symbols.

    E.g. looking at Paths and Symbols with CCS 6.1.1 under Windows shows that CCS is correctly obtaining the compiler pre-defined symbols:

    Whereas under Linux CCS is not obtaining the compiler pre-defined symbols: